IOI 2004

Submission #1811492

Source codeソースコード

{$mode objfpc}
{$COPERATORS ON}
uses math;
const fi=''; fo='';
type Titems=record w,h:longint; end;
var fin,fout:Text;
    n,R,C,nTest:longint;
    a:array[1..200+3] of Titems;
    f:array[0..600+7,0..600+7] of longint;
procedure doc;
    var i:longint;
    begin
    read(fin,C,R);
    read(fin,n);
        for i:=1 to n do
            read(fin,a[i].w,a[i].h);
    end;
function DP(row,col:longint):longint;
    var Res,i:longint;
    begin
    if F[Row,Col]<>-1 then exit(f[Row,Col]);
    Res:=Row*Col;
        for i:=1 to n do
            if (Row=a[i].h) and (Col=a[i].w) then Res:=0;
    if Res>0 then
        begin
        for i:=1 to Row-1 do
            Res:=min(Res,DP(i,Col)+DP(Row-i,Col));
        for i:=1 to Col-1 do
            Res:=min(Res,DP(Row,i)+DP(Row,Col-i));
        end;
    F[Row,Col]:=Res;
    Exit(Res);
    end;
procedure Solve;
    begin
        fillchar(F,sizeof(F),255);
        writeln(fout,DP(R,C));
    end;
begin
    assign(fin,fi);
    assign(fout,fo);
    reset(fin);rewrite(fout);
        //readln(fin,nTest);
       // repeat
            Doc;
            Solve;
        //dec(nTest);
        //until nTest=0;
    close(fin);close(fout);
end.

Submission

Task問題 13 - Phidias
User nameユーザ名 ndhp2000
Created time投稿日時
Language言語 Pascal (FPC 2.6.2)
Status状態 TLE
Score得点 85
Source lengthソースコード長 1230 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

/usr/bin/ld.bfd: warning: ./link.res contains output sections; did you forget -T?

Test case

Set

Set name Score得点 / Max score Cases
Set01 5 / 5 01
Set02 5 / 5 02
Set03 5 / 5 03
Set04 5 / 5 04
Set05 5 / 5 05
Set06 5 / 5 06
Set07 5 / 5 07
Set08 5 / 5 08
Set09 5 / 5 09
Set10 5 / 5 10
Set11 5 / 5 11
Set12 5 / 5 12
Set13 5 / 5 13
Set14 5 / 5 14
Set15 5 / 5 15
Set16 5 / 5 16
Set17 0 / 5 17
Set18 0 / 5 18
Set19 5 / 5 19
Set20 0 / 5 20

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01 AC 1 ms 1664 KB
02 AC 1 ms 1664 KB
03 AC 1 ms 1664 KB
04 AC 1 ms 1664 KB
05 AC 1 ms 1664 KB
06 AC 1 ms 1664 KB
07 AC 1 ms 1664 KB
08 AC 1 ms 1664 KB
09 AC 1 ms 1664 KB
10 AC 1 ms 1664 KB
11 AC 118 ms 1664 KB
12 AC 696 ms 1664 KB
13 AC 856 ms 1664 KB
14 AC 991 ms 1664 KB
15 AC 943 ms 1664 KB
16 AC 327 ms 1664 KB
17 TLE
18 TLE
19 AC 997 ms 1664 KB
20 TLE