2048. Calendar

10175102262 LarsPendragon

2048可是2的11次方啊,这题都不做的?(附省内存无脑算法)

#include <iostream>
using namespace std;
int main()
{
    int d, m, all[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};
    while(cin>>d>>m)
    {
        if(m<1||m>12||d<1||d>all[m+1]-all[m])cout<<"Impossible"<<endl;
        else cout<<(d+all[m]-1)%7+1<<endl;
    }
    return 0;
}
你当前正在回复 博客/题目
存在问题!