Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:注意这组数据——好东东In Reply To:注意这组数据 Posted by:bergkamp at 2006-08-04 20:38:33 > 4. uayet 259 > 正解是 13 ahau 364 > 而不是13 ahau 365 > 看看你的程序是不是 少了点情况没考虑 :) > cout 和 printf都可以AC 好的测试数据,我居然把最后一个月落下了,哈哈…… 作为反馈,贴上我的垃圾代码,请大家指点(Accepted 132K 15MS C++ 728B ): #include <iostream> using namespace std; void main() { int count; cin>>count; cout<<count<<endl; char mounth[15]; char map[40] = "lllinnmmmpppppssrrjkhbbaaaocccccgddddfe"; char *mounth2[20] = { "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; while( count-- ) { int day,year; cin>>day>>mounth>>mounth>>year; int m = map[mounth[0]+mounth[1]-200] - 'a'; if(m == 9 && mounth[0] == 'k') m = 16; long days = 365*year + m*20 +day;//没有判断输入的格式 year = days/260; day = days%260; m = day%20; day = day%13+1; cout<<day<<" "<<mounth2[m]<<" "<<year<<endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator