Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
2612 | 孙浚轩 | 18岁生日 | C++ | Runtime Error | 1996 MS | 260 KB | 1370 | 2024-01-15 22:26:55 |
#include<iostream> using namespace std; int isleapyear(int x){ if((x%400==0)||(x%4==0)&&(x%100!=0)) return 1; else return 0; } int main(){ int t; cin>>t; while(t--){ int y,m,d; char c1,c2; cin>>y>>c1>>m>>c2>>d; int y2=y+18,m2=m,d2=d,ds=0,mld; if(m==2&&d==29) cout<<-1; else{ while(y!=y2||m!=m2||d!=d2){ while(m!=13){ switch(m){ case 1:case 3:case 5:case 7:case 8:case 10:case 12: mld=31; break; case 4:case 6:case 9:case 11: mld=30; break; case 2: if(isleapyear(y)==1) mld=29; else mld=28; break; } while(d!=mld){ d++; ds++; } m++; d=1; ds++; } y++; m=1; } cout<<ds<<endl; } } return 0; }
Runtime Error:[ERROR] A not allowed system call. Call ID:275