提出 #485184


ソースコード 拡げる

#include<cstdio>
#include<cstring>
#define N 21
using namespace std;
int dp[N][N][N][N];
char s[N][N];
int f(int x1,int x2,int y1,int y2){
    if(x1>=x2||y1>=y2) return 0;
    if(dp[x1][x2][y1][y2]>=0) return dp[x1][x2][y1][y2];
    bool used[512]={};
    for(int i=x1;i<x2;i++){
        for(int j=y1;j<y2;j++){
            if(s[i][j]=='X') continue;
            int tmp=f(x1,i,y1,j)^f(i+1,x2,y1,j)^f(x1,i,j+1,y2)^f(i+1,x2,j+1,y2);
            used[tmp]=true;
        }
    }
    int ans=0;
    while(used[ans]) ans++;
    return dp[x1][x2][y1][y2]=ans;
}
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++) scanf("%s",s[i]);
    memset(dp,-1,sizeof(dp));
    if(f(0,n,0,m)) printf("First\n");
    else printf("Second\n");
    return 0;
}

提出情報

提出日時
問題 L - Wall Making Game
ユーザ NCTU_Thor
言語 C++11 (GCC 4.9.2)
得点 100
コード長 792 Byte
結果 AC
実行時間 76 ms
メモリ 1572 KiB

コンパイルエラー

./Main.cpp: In function ‘int main()’:
./Main.cpp:24:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
                        ^
./Main.cpp:25:42: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     for(int i=0;i<n;i++) scanf("%s",s[i]);
                                          ^

ジャッジ結果

セット名 All
得点 / 配点 100 / 100
結果
AC × 112
セット名 テストケース
All 00_sample_01, 00_sample_02, 00_sample_03, 01_random_small_01, 01_random_small_02, 01_random_small_03, 01_random_small_04, 01_random_small_05, 01_random_small_06, 01_random_small_07, 01_random_small_08, 01_random_small_09, 01_random_small_10, 01_random_small_11, 01_random_small_12, 01_random_small_13, 01_random_small_14, 01_random_small_15, 01_random_small_16, 01_random_small_17, 01_random_small_18, 01_random_small_19, 01_random_small_20, 01_random_small_21, 01_random_small_22, 01_random_small_23, 01_random_small_24, 01_random_small_25, 01_random_small_26, 01_random_small_27, 01_random_small_28, 01_random_small_29, 01_random_small_30, 02_random_medium_01, 02_random_medium_02, 02_random_medium_03, 02_random_medium_04, 02_random_medium_05, 02_random_medium_06, 02_random_medium_07, 02_random_medium_08, 02_random_medium_09, 02_random_medium_10, 03_random_large_01, 03_random_large_02, 03_random_large_03, 03_random_large_04, 03_random_large_05, 03_random_large_06, 03_random_large_07, 03_random_large_08, 03_random_large_09, 03_random_large_10, 04_random_maximum_01, 04_random_maximum_02, 04_random_maximum_03, 04_random_maximum_04, 04_random_maximum_05, 04_random_maximum_06, 04_random_maximum_07, 04_random_maximum_08, 04_random_maximum_09, 04_random_maximum_10, 05_none_01, 05_none_02, 05_none_03, 05_none_04, 05_none_05, 05_none_06, 05_none_07, 05_none_08, 05_none_09, 05_none_10, 06_all_01, 06_all_02, 06_all_03, 06_all_04, 06_all_05, 07_cross_parallel_01, 07_cross_parallel_02, 07_cross_parallel_03, 07_cross_parallel_04, 07_cross_parallel_05, 07_cross_parallel_06, 07_cross_parallel_07, 07_cross_parallel_08, 07_cross_parallel_09, 07_cross_parallel_10, 07_square_perm_01, 07_square_perm_02, 07_square_perm_03, 07_square_perm_04, 07_square_perm_05, 07_square_perm_06, 07_square_perm_07, 07_square_perm_08, 07_square_perm_09, 07_square_perm_10, 08_square_permL_01, 08_square_permL_02, 08_square_permL_03, 08_square_permL_04, 08_square_permL_05, 08_square_permL_06, 08_square_permL_07, 08_square_permL_08, 08_square_permL_09, 08_square_permL_10, 99_teuchi_01, 99_teuchi_02, 99_teuchi_03, 99_teuchi_04
ケース名 結果 実行時間 メモリ
00_sample_01 AC 26 ms 1564 KiB
00_sample_02 AC 27 ms 1560 KiB
00_sample_03 AC 26 ms 1560 KiB
01_random_small_01 AC 26 ms 1560 KiB
01_random_small_02 AC 24 ms 1552 KiB
01_random_small_03 AC 26 ms 1440 KiB
01_random_small_04 AC 25 ms 1364 KiB
01_random_small_05 AC 25 ms 1556 KiB
01_random_small_06 AC 25 ms 1556 KiB
01_random_small_07 AC 25 ms 1560 KiB
01_random_small_08 AC 26 ms 1436 KiB
01_random_small_09 AC 26 ms 1436 KiB
01_random_small_10 AC 25 ms 1560 KiB
01_random_small_11 AC 24 ms 1556 KiB
01_random_small_12 AC 25 ms 1368 KiB
01_random_small_13 AC 24 ms 1444 KiB
01_random_small_14 AC 25 ms 1368 KiB
01_random_small_15 AC 26 ms 1448 KiB
01_random_small_16 AC 24 ms 1552 KiB
01_random_small_17 AC 25 ms 1556 KiB
01_random_small_18 AC 24 ms 1532 KiB
01_random_small_19 AC 26 ms 1432 KiB
01_random_small_20 AC 26 ms 1452 KiB
01_random_small_21 AC 26 ms 1436 KiB
01_random_small_22 AC 26 ms 1564 KiB
01_random_small_23 AC 26 ms 1440 KiB
01_random_small_24 AC 26 ms 1572 KiB
01_random_small_25 AC 26 ms 1452 KiB
01_random_small_26 AC 27 ms 1556 KiB
01_random_small_27 AC 27 ms 1556 KiB
01_random_small_28 AC 25 ms 1436 KiB
01_random_small_29 AC 26 ms 1440 KiB
01_random_small_30 AC 26 ms 1440 KiB
02_random_medium_01 AC 26 ms 1364 KiB
02_random_medium_02 AC 26 ms 1560 KiB
02_random_medium_03 AC 26 ms 1456 KiB
02_random_medium_04 AC 27 ms 1548 KiB
02_random_medium_05 AC 26 ms 1568 KiB
02_random_medium_06 AC 28 ms 1540 KiB
02_random_medium_07 AC 25 ms 1368 KiB
02_random_medium_08 AC 25 ms 1556 KiB
02_random_medium_09 AC 25 ms 1368 KiB
02_random_medium_10 AC 23 ms 1568 KiB
03_random_large_01 AC 56 ms 1560 KiB
03_random_large_02 AC 42 ms 1436 KiB
03_random_large_03 AC 58 ms 1560 KiB
03_random_large_04 AC 45 ms 1364 KiB
03_random_large_05 AC 45 ms 1560 KiB
03_random_large_06 AC 34 ms 1448 KiB
03_random_large_07 AC 34 ms 1560 KiB
03_random_large_08 AC 30 ms 1440 KiB
03_random_large_09 AC 30 ms 1568 KiB
03_random_large_10 AC 28 ms 1368 KiB
04_random_maximum_01 AC 76 ms 1496 KiB
04_random_maximum_02 AC 75 ms 1564 KiB
04_random_maximum_03 AC 71 ms 1556 KiB
04_random_maximum_04 AC 67 ms 1560 KiB
04_random_maximum_05 AC 63 ms 1564 KiB
04_random_maximum_06 AC 57 ms 1552 KiB
04_random_maximum_07 AC 47 ms 1556 KiB
04_random_maximum_08 AC 43 ms 1556 KiB
04_random_maximum_09 AC 35 ms 1368 KiB
04_random_maximum_10 AC 29 ms 1560 KiB
05_none_01 AC 25 ms 1560 KiB
05_none_02 AC 26 ms 1556 KiB
05_none_03 AC 29 ms 1552 KiB
05_none_04 AC 32 ms 1556 KiB
05_none_05 AC 30 ms 1368 KiB
05_none_06 AC 30 ms 1556 KiB
05_none_07 AC 43 ms 1360 KiB
05_none_08 AC 26 ms 1364 KiB
05_none_09 AC 37 ms 1368 KiB
05_none_10 AC 39 ms 1556 KiB
06_all_01 AC 24 ms 1364 KiB
06_all_02 AC 25 ms 1428 KiB
06_all_03 AC 25 ms 1560 KiB
06_all_04 AC 26 ms 1436 KiB
06_all_05 AC 24 ms 1572 KiB
07_cross_parallel_01 AC 26 ms 1444 KiB
07_cross_parallel_02 AC 32 ms 1440 KiB
07_cross_parallel_03 AC 49 ms 1452 KiB
07_cross_parallel_04 AC 37 ms 1444 KiB
07_cross_parallel_05 AC 32 ms 1448 KiB
07_cross_parallel_06 AC 40 ms 1436 KiB
07_cross_parallel_07 AC 51 ms 1440 KiB
07_cross_parallel_08 AC 47 ms 1436 KiB
07_cross_parallel_09 AC 33 ms 1448 KiB
07_cross_parallel_10 AC 38 ms 1564 KiB
07_square_perm_01 AC 25 ms 1436 KiB
07_square_perm_02 AC 25 ms 1452 KiB
07_square_perm_03 AC 26 ms 1448 KiB
07_square_perm_04 AC 25 ms 1564 KiB
07_square_perm_05 AC 26 ms 1444 KiB
07_square_perm_06 AC 25 ms 1564 KiB
07_square_perm_07 AC 25 ms 1440 KiB
07_square_perm_08 AC 26 ms 1568 KiB
07_square_perm_09 AC 26 ms 1444 KiB
07_square_perm_10 AC 24 ms 1564 KiB
08_square_permL_01 AC 26 ms 1448 KiB
08_square_permL_02 AC 25 ms 1440 KiB
08_square_permL_03 AC 26 ms 1568 KiB
08_square_permL_04 AC 25 ms 1568 KiB
08_square_permL_05 AC 26 ms 1452 KiB
08_square_permL_06 AC 26 ms 1448 KiB
08_square_permL_07 AC 26 ms 1436 KiB
08_square_permL_08 AC 26 ms 1564 KiB
08_square_permL_09 AC 26 ms 1444 KiB
08_square_permL_10 AC 26 ms 1448 KiB
99_teuchi_01 AC 24 ms 1568 KiB
99_teuchi_02 AC 24 ms 1568 KiB
99_teuchi_03 AC 25 ms 1444 KiB
99_teuchi_04 AC 25 ms 1560 KiB