ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1201. Какой сегодня день?

OH damn. it got me MAD anyone view..
Послано Locomotive 10 мар 2003 20:23
i got WA again but all tests and all discuss are OK
1-is all tested ok? (such as 31 2 2003)
2-is spaces after end of line important to be or not?
such as
..[31]
...30
or
..[31]
...30
3-also
is it any different in
24..[31]
25......
and
24..[31]
25.....
and
24..[31]
25
????
also may you give me some other tests???
i check it by about 10 tests of discuss and also
about 20time by windows calender...
:(((
Aidin_n7@hotmail.com

~*~*~*~*~~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Const
  NameDay             : Array [0..6] of String =
                        (('mon'),('tue'),('wed'),('thu'),
                         ('fri'),('sat'),('sun'));
  Moon                : Array [0..11] of byte =
                        ((0),(3),(0),(3),(2),(3),
                         (2),(3),(3),(2),(3),(2));
Var
  DD, MM, Fst, PP, MX :byte;
  YY, I               :Integer;
  S                   :Array[0..6] of string;
  T                   :String[2];
  Mark                :Array[0..800] of boolean;

begin
  ReadLn(DD,MM,YY); YY:=YY-1600;
  For I := 0 to 150  do Mark[4  *I] := True;
  For I := 0 to 8    do Mark[100*I] := False;
  For I := 0 To 2    do Mark[400*I] := True;

  fst:=(5+YY) mod 7;

  For I := 0 to yy-1 do
    If Mark[I] then
      fst:=(fst+1) Mod 7;
  If mark[YY] and (MM>2) then
    fst:=(fst+1) mod 7;
  Pp:=0;
  For I:=1 TO (MM-1) Do
    Pp:=(Pp+Moon[I]) Mod 7;
  fst:=(fst+Pp) mod 7;

  For I:=0 To 6 Do
    S[I]:=Nameday[I];
  For I:=0 to Fst-1 Do
    S[I]:=S[I]+'    ';
  For I:=Fst to 6 Do
    If DD=I+1-fst Then
      S[I]:=S[I]+' ['+' '+chr(48+I+1-fst)+']'
    else
      S[I]:=S[I]+'  '+' '+chr(48+I+1-fst);

  MX:=28+Moon[MM];
  If Mark[YY] and (Mm=2) then
   Inc(MX);
  For I:= 8-Fst To MX Do
  begin
    If I<10 Then
      T:=' '+chr(48+I)
    Else
      T:=chr(48+(I div 10))+chr(48+(I Mod 10));
    Pp:=(I+fst-1) mod 7;
    S[Pp]:=S[Pp]+' ';
    If DD<>I-7 then
      S[Pp]:=S[Pp]+' ';
    If I=DD then
      S[Pp]:=S[Pp]+'['+T+']'
    else
      S[Pp]:=S[Pp]+' '+T;
  End;
  mx:=0;
  For I:=0 to 6 do
    if length(S[I])>mx then
      MX:=length(s[i]);
  For I:=0 To 6 do
  begin
    write(S[I]);
    if mx-1>length(s[i]) then
      For Pp:=1 to Mx-length(S[I]) do
        write(' ');
    writeln;
  end;
End.
i got AC... thanks myself for my helps :D dont waste your time no matter spaces before end of file
Послано Locomotive 10 мар 2003 21:50
> i got WA again but all tests and all discuss are OK
> 1-is all tested ok? (such as 31 2 2003)
> 2-is spaces after end of line important to be or not?
> such as
> ..[31]
> ...30
> or
> ..[31]
> ...30
> 3-also
> is it any different in
> 24..[31]
> 25......
> and
> 24..[31]
> 25.....
> and
> 24..[31]
> 25
> ????
> also may you give me some other tests???
> i check it by about 10 tests of discuss and also
> about 20time by windows calender...
> :(((
> Aidin_n7@hotmail.com
>
> ~*~*~*~*~~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
> Const
>   NameDay             : Array [0..6] of String =
>                         (('mon'),('tue'),('wed'),('thu'),
>                          ('fri'),('sat'),('sun'));
>   Moon                : Array [0..11] of byte =
>                         ((0),(3),(0),(3),(2),(3),
>                          (2),(3),(3),(2),(3),(2));
> Var
>   DD, MM, Fst, PP, MX :byte;
>   YY, I               :Integer;
>   S                   :Array[0..6] of string;
>   T                   :String[2];
>   Mark                :Array[0..800] of boolean;
>
> begin
>   ReadLn(DD,MM,YY); YY:=YY-1600;
>   For I := 0 to 150  do Mark[4  *I] := True;
>   For I := 0 to 8    do Mark[100*I] := False;
>   For I := 0 To 2    do Mark[400*I] := True;
>
>   fst:=(5+YY) mod 7;
>
>   For I := 0 to yy-1 do
>     If Mark[I] then
>       fst:=(fst+1) Mod 7;
>   If mark[YY] and (MM>2) then
>     fst:=(fst+1) mod 7;
>   Pp:=0;
>   For I:=1 TO (MM-1) Do
>     Pp:=(Pp+Moon[I]) Mod 7;
>   fst:=(fst+Pp) mod 7;
>
>   For I:=0 To 6 Do
>     S[I]:=Nameday[I];
>   For I:=0 to Fst-1 Do
>     S[I]:=S[I]+'    ';
>   For I:=Fst to 6 Do
>     If DD=I+1-fst Then
>       S[I]:=S[I]+' ['+' '+chr(48+I+1-fst)+']'
>     else
>       S[I]:=S[I]+'  '+' '+chr(48+I+1-fst);
>
>   MX:=28+Moon[MM];
>   If Mark[YY] and (Mm=2) then
>    Inc(MX);
>   For I:= 8-Fst To MX Do
>   begin
>     If I<10 Then
>       T:=' '+chr(48+I)
>     Else
>       T:=chr(48+(I div 10))+chr(48+(I Mod 10));
>     Pp:=(I+fst-1) mod 7;
>     S[Pp]:=S[Pp]+' ';
>     If DD<>I-7 then
>       S[Pp]:=S[Pp]+' ';
>     If I=DD then
>       S[Pp]:=S[Pp]+'['+T+']'
>     else
>       S[Pp]:=S[Pp]+' '+T;
>   End;
>   mx:=0;
>   For I:=0 to 6 do
>     if length(S[I])>mx then
>       MX:=length(s[i]);
>   For I:=0 To 6 do
>   begin
>     write(S[I]);
>     if mx-1>length(s[i]) then
>       For Pp:=1 to Mx-length(S[I]) do
>         write(' ');
>     writeln;
>   end;
> End.
Re: OH damn. it got me MAD anyone view..
Послано Marcin Mika 10 мар 2003 21:58

What's the point of doing easy problems like this?
just do the hard ones :)
speaking of which,  did you get my e-mail a few days ago???
Yes Marcin, but i couldn`t reply you... i will do it tonight or tomorrow
Послано Locomotive 10 мар 2003 22:26