IOI 2004

Submission #330299

Source codeソースコード

#include<bits/stdc++.h>

using namespace std;

#define st first
#define nd second

int n;

pair<int,int> A[205];

int DP[605][605];

int f(int x,int y){

   if(DP[x][y]!=-1)
      return DP[x][y];

   int bek=0,i,mn=INT_MAX;

   for(i=1 ; i<=n ; i++)
      if(A[i].st<=x and A[i].nd<=y){
         bek=1;
         mn=min( mn , min( f(A[i].st,y-A[i].nd) + f(x-A[i].st,y) , f(x-A[i].st,A[i].nd) + f(x,y-A[i].nd) ) );
      }

   if(bek)
      return DP[x][y]=mn;

   return DP[x][y]=x*y;
}

int main(){

   memset(DP,-1,sizeof DP);

   int w,h,i;

   scanf("%d %d",&w,&h);

   scanf("%d",&n);

   for(i=1 ; i<=n ; i++)
      scanf("%d %d",&A[i].st,&A[i].nd);
   
   printf("%d",f(w,h));

   return 0;
}

Submission

Task問題 13 - Phidias
User nameユーザ名 Bera
Created time投稿日時
Language言語 C++ (G++ 4.6.4)
Status状態 WA
Score得点 0
Source lengthソースコード長 749 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

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

./Main.cpp: In function ‘int main()’:
./Main.cpp:39:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:41:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:44:39: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

Test case

Set

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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01 WA
02 WA
03 WA
04 WA
05 WA
06 WA
07 WA
08 WA
09 WA
10 WA
11 WA
12 WA
13 WA
14 WA
15 WA
16 WA
17 WA
18 WA
19 WA
20 WA