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 bage at 2010-12-05 20:03:21 on Problem 1008
const
a:array[0..19] of string=('imix','ik','akbal','kan','chicchan','cimi','manik','lamat','muluk','ok','chuen','eb','ben','ix','mem','cib','caban','eznab','canac','ahau');
day:array[0..19] of string=('uayet','pop','no','zip','zotz','tzec','xul','yoxkin','mol','chen','yax','zac','ceh','mac','kankin','muan','pax','koyab','cumhu','uayet');
var
s,h,h1:string;
total,num,year,years,t,i,j,time,c,n:longint;

{a:array[0..19] of string=('ahau','imix','ik','akbal','kan','chicchan','cimi','manik','lamat','muluk','ok','chuen','eb','ben','ix','mem','cib','caban','eznab','canac');
day:array[0..20] of string=('uayet','pop','no','zip','zotz','tzec','xul','yoxkin','mol','chen','yax','zac','ceh','mac','kankin','muan','pax','koyab','cumhu','uayet');}
    function check2(s:string):longint;
 begin
   if s='pop' then exit(1);
   if s='no' then exit(2);
   if s='zip' then exit(3);
   if s='zotz' then exit(4);
   if s='tzec' then exit(5);
   if s='xul' then exit(6);
   if s='yoxkin' then exit(7);
   if s='mol' then exit(8);
   if s='chen' then exit(9);
   if s='yax' then exit(10);
   if s='zac' then exit(11);
   if s='che' then exit(12);
   if s='mac' then exit(13);
   if s='kankin' then exit(14);
   if s='muan' then exit(15);
   if s='pax' then exit(16);
   if s='koyad' then exit(17);
   if s='cumhu' then exit(18);

   if s='uayet' then exit(19);


end;
function check(s:string):longint;
 begin
   if s='pop' then exit(20);
   if s='no' then exit(40);
   if s='zip' then exit(60);
   if s='zotz' then exit(80);
   if s='tzec' then exit(100);
   if s='xul' then exit(120);
   if s='yoxkin' then exit(140);
   if s='mol' then exit(160);
   if s='chen' then exit(180);
   if s='yax' then exit(200);
   if s='zac' then exit(220);
   if s='che' then exit(240);
   if s='mac' then exit(260);
   if s='kankin' then exit(280);
   if s='muan' then exit(300);
   if s='pax' then exit(320);
   if s='koyad' then exit(340);
   if s='cumhu' then exit(360);
  if year<>0 then
   begin
   if s='uayet' then exit(365);
  end
  else exit(0);
end;

 begin{main}
  readln(n);
 writeln(n);

  for i:=1 to n do
   begin
    readln(s);
    h:='';
    for j:=1 to pos('.',s)-1 do
     h:=h+s[j];
     val(h,t);
     delete(s,pos(' ',s),1);
     h:='';
    for j:=pos('.',s)+1 to pos(' ',s)-1 do
     h:=h+s[j];
     c:=check2(h);
      h1:='';
    for j:=pos(' ',s)+1 to length(s) do
      h1:=h1+s[j];
      val(h1,year);
       total:=0;
    if year<>0 then total:=year*365
     else total:=0;
    total:=total+t+check(day[c-1]);
      years:=(total div 20)div 13;
      time:=total mod 20;
      num:=total mod 13;
    writeln(num+1,' ',a[time],' ',years);

     end;
         end.


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