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; }
2048可是2的11次方啊,这题都不做的?(附省内存无脑算法)