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 DavidDyn at 2015-02-12 14:47:30 on Problem 1008
#include <stdio.h>

void main()
{
	int i, incount;
	char inhash[2955];
	char outhash[20][9] = {"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
	char inday;
	char inmon[7];
	int inyear;
	int outyear;
	
	inhash[1674] = '\x0';
	inhash[1418] = '\x1';
	inhash[2948] = '\x2';
	inhash[2954] = '\x3';
	inhash[2197] = '\x4';
	inhash[2704] = '\x5';
	inhash[2826] = '\x6';
	inhash[1290] = '\x7';
	inhash[3] = '\x8';
	inhash[2812] = '\x9';
	inhash[2940] = '\xA';
	inhash[0] = '\xB';
	inhash[1276] = '\xC';
	inhash[1020] = '\xD';
	inhash[1296] = '\xE';
	inhash[1660] = '\xF';
	inhash[1034] = '\x10';
	inhash[16] = '\x11';
	inhash[2300] = '\x12';

	scanf("%d", &incount);
	printf("%d\n", incount);
	for (i = 0; i < incount; ++i)
	{
		scanf("%d. %s %d", &inday, inmon, &inyear);
		inyear = inyear * 365 + inhash[inmon[0] * 128 + inmon[1] - 12773] * 20 + inday;
		outyear = inyear / 260;
		inyear %= 260;
		printf("%d %s %d\n", inyear % 13 + 1, outhash[inyear % 20], outyear);
	}
}

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