| ||||||||||
| 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:Notice~难以置信,这个题通过率这么低~测试数据比较阴~1Y!贡献脑残代码~#include<iostream>
#include<string>
#include<fstream>
using namespace std;
int main()
{
int tot, day, year, k, month, sumday;
string a, b;
cin>>tot;
cout<<tot<<endl;
while (tot--)
{
day = month = sumday = 0;
k = 1;
cin>>a>>b>>year;
for (int i = (int)a.length() - 2; i >= 0; i--)
{
day += (a[i] - '0') * k;
k *= 10;
}
day++;
sumday += day;
if (b == "pop")month = 1;
else if (b == "no")month = 2;
else if (b == "zip")month = 3;
else if (b == "zotz")month = 4;
else if (b == "tzec")month = 5;
else if (b == "xul")month = 6;
else if (b == "yoxkin")month = 7;
else if (b == "mol")month = 8;
else if (b == "chen")month = 9;
else if (b == "yax")month = 10;
else if (b == "zac")month = 11;
else if (b == "ceh")month = 12;
else if (b == "mac")month = 13;
else if (b == "kankin")month = 14;
else if (b == "muan")month = 15;
else if (b == "pax")month = 16;
else if (b == "koyab")month = 17;
else if (b == "cumhu")month = 18;
else month = 19;
sumday += (month - 1) * 20;
sumday += year * 365;
int year1;
if (sumday % 260)year1 = sumday / 260;
else year1 = sumday / 260 - 1;
int temp = sumday % 260;
int month1;
if (temp % 20)month1 = temp % 20;
else month1 = 20;
if (temp % 13)printf("%d ", (temp % 13));
else printf("13 ");
switch(month1)
{
case 1:printf("imix");break;
case 2:printf("ik");break;
case 3:printf("akbal");break;
case 4:printf("kan");break;
case 5:printf("chicchan");break;
case 6:printf("cimi");break;
case 7:printf("manik");break;
case 8:printf("lamat");break;
case 9:printf("muluk");break;
case 10:printf("ok");break;
case 11:printf("chuen");break;
case 12:printf("eb");break;
case 13:printf("ben");break;
case 14:printf("ix");break;
case 15:printf("mem");break;
case 16:printf("cib");break;
case 17:printf("caban");break;
case 18:printf("eznab");break;
case 19:printf("canac");break;
case 20:printf("ahau");break;
default:break;
}
printf(" %d\n", year1);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator