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

我没错啊!! 怎么回事??

Posted by ppdd20051101 at 2007-02-07 22:49:14 on Problem 1008
// 还有更BT的数据证明我是错的吗???

#include <iostream>
#include <string>
using namespace std;

int chage(int p, string t, int g)
{
	if( t == "pop")
		return (365 * g + 0 * 20 + p);
	else if( t == "no")
		return (365 * g + 1 * 20 + p);
	else if( t == "zip")
		return (365 * g + 2 * 20 + p);
	else if( t == "zotz")
		return (365 * g + 3 * 20 + p);
	else if( t == "tzec")
		return (365 * g + 4 * 20 + p);
	else if( t == "xul")
		return (365 * g + 5 * 20 + p);
	else if( t == "yoxkin")
		return (365 * g + 6 * 20 + p);
	else if( t == "mol")
		return (365 * g + 7 * 20 + p);
	else if( t == "chen")
		return (365 * g + 8 * 20 + p);
	else if( t == "yax")
		return (365 * g + 9 * 20 + p);
	else if( t == "zac")
		return (365 * g + 10 * 20 + p);
	else if( t == "ceh")
		return (365 * g + 11 * 20 + p);
	else if( t == "mac")
		return (365 * g + 12 * 20 + p);
	else if( t == "kankin")
		return (365 * g + 13 * 20 + p);
	else if( t == " muan")
		return (365 * g + 14 * 20 + p);
	else if( t == "pax")
		return (365 * g + 15 * 20 + p);
	else if( t == "koyab")
		return (365 * g + 16 * 20 + p);
	else if( t == "cumhu")
		return (365 * g + 17 * 20 + p);
	else if( t == "uayet")
		return (365 * g + 18 * 20 + p);
	else
		return -1;
}

int main()
{
	int Number_data;
	cin>>Number_data;

	int control = Number_data;

	int a = 0, c = 0;
	char d = '.';
	string b;

	int* MainArray = new int[3 * Number_data];

	int ans_a = 0;
	int ans_b = 0;
	int ans_c = 0;

	while(control > 0)
	{
		int t  = 0;
		cin>>a>>d>>b>>c;
		if ( c >= 5000)
			exit(0);
		else
			t = chage(a,b,c);

		MainArray[(Number_data - control) * 3] = ans_a = t % 13 + 1;
		MainArray[(Number_data - control) * 3 + 1] = ans_b = t % 20 + 1;
		MainArray[(Number_data - control) * 3 + 2] = ans_c = t / 260 ;

		control--;
	}

	cout<<Number_data<<endl;
	for ( int m2 = 0; m2 < Number_data; m2++)
	{
		if(MainArray[m2 * 3 + 1] == 1)
			cout<<MainArray[m2 * 3]<<" "<<"imix"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 2)
			cout<<MainArray[m2 * 3]<<" "<<"ik"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 3)
			cout<<MainArray[m2 * 3]<<" "<<"akbal"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 4)
			cout<<MainArray[m2 * 3]<<" "<<"kan"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 5)
			cout<<MainArray[m2 * 3]<<" "<<"chicchan"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 6)
			cout<<MainArray[m2 * 3]<<" "<<"cimi"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 7)
			cout<<MainArray[m2 * 3]<<" "<<"manik"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 8)
			cout<<MainArray[m2 * 3]<<" "<<"lamat "<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 9)
			cout<<MainArray[m2 * 3]<<" "<<"muluk "<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 10)
			cout<<MainArray[m2 * 3]<<" "<<"ok"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 11)
			cout<<MainArray[m2 * 3]<<" "<<"chuen"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 12)
			cout<<MainArray[m2 * 3]<<" "<<"eb"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 13)
			cout<<MainArray[m2 * 3]<<" "<<"ben"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 14)
			cout<<MainArray[m2 * 3]<<" "<<"ix"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 15)
			cout<<MainArray[m2 * 3]<<" "<<"mem"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 16)
			cout<<MainArray[m2 * 3]<<" "<<"cib"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 17)
			cout<<MainArray[m2 * 3]<<" "<<"caban"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 18)
			cout<<MainArray[m2 * 3]<<" "<<"eznab"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 19)
			cout<<MainArray[m2 * 3]<<" "<<"canac"<<" "<<MainArray[m2 * 3 +2]<<endl;
		else if(MainArray[m2 * 3 + 1] == 20)
			cout<<MainArray[m2 * 3]<<" "<<"ahau"<<" "<<MainArray[m2 * 3 +2]<<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