Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

测试数据过了 但一直是 WA 群里的特殊数据我的也是正确的。。十分蛋疼

Posted by tobykentrunzhi at 2014-03-27 16:45:24 on Problem 1008 and last updated at 2014-03-27 16:46:07
#include <iostream>

#include <string>

using namespace std;


const string  haab[18]={"pop","no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu"};
const string Tzolkin[20]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};


int main(){
	int lines;
	cin>>lines;
	int count=1;

	cout<<lines<<endl;

	while (count<=lines)
	{
		string day;
		string month;
		int years;
		int mon;
		int d;
		cin>>day>>month>>years;

		if (years>=5000)
			break;
		
		d=atoi(day.substr(0,day.length()).c_str());

		if (month=="uayet"){
		mon=18;
		}
		else{
			for (int i=0;i<18;i++)
		{
			if (month==haab[i])
			{
				mon=i;
				break;
			}
		}
			count++;
	}
		
		
		

        long days = years*365 +mon*20+d;

		// convert to tzolkin

		int tzyear= days/260;
		int tzdays= days%260;

		int tzday= tzdays%13;
		int tzmonth= tzdays%20;

		cout<<tzday+1<< " "<<Tzolkin[tzmonth]<<" "<<tzyear<<endl;


	}


	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator