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

Re:请大家看看是什么问题,小弟实在是无计可施了,sample已经过了,可就是wronganswer

Posted by niuhan2005 at 2005-01-04 19:01:10 on Problem 1008
In Reply To:请大家看看是什么问题,小弟实在是无计可施了, Posted by:niuhan2005 at 2005-01-04 18:59:26
#include<iostream.h>
#include<memory.h>

void main()
{
	int N;
	int i,j;
	cin>>N;
	char data[10000][5];
	char month[10000][20];
	int year[10000];
	int count[10000];
	int total[10000];
	int remain[10000];
	char belong[20][10]={"pop","no","zip","zotz","tzec","xul", 
			"yoxkin","ol","chen","yax","zac","ceh", 
			"mac","kankin","muan","pax","koyab","cumhu","uayet"};
	char belong1[20][10]={"imix","ik","akbal","kan", 
		"chicchan","cimi","manik","lamat",
		"muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
	char belong2[20][10]={"0.","1.","2.","3.","4.","5.","6.","7.","8.",
		"9.","10.","11.","12.","13.","14.","15.","16.","17.","18.","19."};
	for(i=0;i<N;i++){
		cin>>data[i]>>month[i]>>year[i];
	}	
	bool record1[10000];
	int record[10000];
	bool record2[10000];
	int record3[10000];
	int peo[10000];
	memset(record1,0,sizeof(record1));
	memset(record2,0,sizeof(record2));
	for(i=0;i<19;i++){
		for(j=0;j<N;j++){
			if((record1[j]==0)&&belong[i][0]==month[j][0]&&belong[i][1]==month[j][1]){
				record[j]=i;
				record1[j]=1;
			}
		}
	}
	for(i=0;i<20;i++){
		for(j=0;j<N;j++){
			if((record2[j]==0)&&belong2[i][0]==data[j][0]&&belong2[i][1]==data[j][1]&&belong2[i][2]==data[j][2]){
				record3[j]=i;
				record2[j]=1;
			}
		}
	}
	for(i=0;i<N;i++){	
		int   temp=year[i]*365+record[i]*20+record3[i]+1;
		total[i]=temp/260;
		remain[i]=(temp%260)%20;
		if(remain[i]==0){remain[i]=20;}
		peo[i]=(temp%260)%13;
		if(peo[i]==0){peo[i]=13;}
	}
	cout<<N<<endl;
	for(i=0;i<N;i++){
		cout<<peo[i]<<" "<<belong1[remain[i]-1]<<" "<<total[i]<<endl;
	}
	
}
		



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