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 E20614076 at 2008-07-16 16:21:50 on Problem 1008
#include<iostream>
#include<string>
#include<malloc.h>
#include<vector>
using namespace std;
int main()
{
	long int i,N,year,k,j;
	long int *sum;
	string s[]={"pop","no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan","pax", "koyab", "cumhu","uayet"};
	string s1[]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
	string s0[]={"0.","1.","2.","3.","4.","5.","6.","7.","8.","9.","10.","11.","12.","13.","14.","15.","16.","17.","18.","19."};
    string s2,s3;
	cin>>N;
	sum=(long int *)malloc(N*sizeof(long int));
	for(i=0;i<N;i++)
	{
		sum[i]=0;
		cin>>s2>>s3;
		cin>>year;
		sum[i]+=365*year;
		for(j=0;j<19&&s[j]!=s3;j++);
		sum[i]=sum[i]+20*j;
		for(j=0;j<20&&s2!=s0[j];j++);
		sum[i]=sum[i]+(j+1);	
		cout<<sum[i]<<endl;
	}
	cout<<N<<endl;
	for(i=0;i<N;i++)
	{
		if(!(sum[i]%260))
		{
			cout<<13<<' ';
			cout<<"ahau"<<' ';
			k=sum[i]/260;
			cout<<k-1<<endl;
		}
		else
		{
			k=sum[i]%13;
		    cout<<k<<' ';
		    k=sum[i]%20;
		    cout<<s1[k-1]<<' ';
		    k=sum[i]/260;
		    cout<<k<<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