結果
問題 | No.437 cwwゲーム |
ユーザー | 👑 testestest |
提出日時 | 2016-10-29 04:10:50 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 396 bytes |
コンパイル時間 | 584 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 08:29:15 |
合計ジャッジ時間 | 1,614 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 0 ms
5,248 KB |
testcase_04 | AC | 0 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 2 ms
5,248 KB |
testcase_08 | AC | 0 ms
5,248 KB |
testcase_09 | AC | 2 ms
5,248 KB |
testcase_10 | AC | 1 ms
5,248 KB |
testcase_11 | AC | 0 ms
5,248 KB |
testcase_12 | AC | 0 ms
5,248 KB |
testcase_13 | AC | 1 ms
5,248 KB |
testcase_14 | AC | 1 ms
5,248 KB |
testcase_15 | AC | 3 ms
5,248 KB |
testcase_16 | AC | 0 ms
5,248 KB |
testcase_17 | AC | 1 ms
5,248 KB |
testcase_18 | AC | 1 ms
5,248 KB |
testcase_19 | AC | 1 ms
5,248 KB |
testcase_20 | AC | 1 ms
5,248 KB |
testcase_21 | AC | 1 ms
5,248 KB |
testcase_22 | AC | 1 ms
5,248 KB |
testcase_23 | AC | 0 ms
5,248 KB |
testcase_24 | AC | 0 ms
5,248 KB |
testcase_25 | AC | 0 ms
5,248 KB |
testcase_26 | AC | 0 ms
5,248 KB |
testcase_27 | AC | 0 ms
5,248 KB |
testcase_28 | AC | 1 ms
5,248 KB |
testcase_29 | AC | 0 ms
5,248 KB |
testcase_30 | AC | 1 ms
5,248 KB |
testcase_31 | AC | 1 ms
5,248 KB |
testcase_32 | AC | 1 ms
5,248 KB |
testcase_33 | AC | 0 ms
5,248 KB |
testcase_34 | AC | 0 ms
5,248 KB |
testcase_35 | AC | 0 ms
5,248 KB |
testcase_36 | AC | 0 ms
5,248 KB |
testcase_37 | AC | 0 ms
5,248 KB |
testcase_38 | AC | 1 ms
5,248 KB |
testcase_39 | AC | 0 ms
5,248 KB |
testcase_40 | AC | 0 ms
5,248 KB |
testcase_41 | AC | 0 ms
5,248 KB |
testcase_42 | AC | 0 ms
5,248 KB |
testcase_43 | AC | 0 ms
5,248 KB |
コンパイルメッセージ
main.c:3:1: warning: data definition has no type or storage class 3 | ans; | ^~~ main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘ans’ [-Wimplicit-int] main.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 5 | f(sum,used){ | ^ main.c: In function ‘f’: main.c:5:1: warning: type of ‘sum’ defaults to ‘int’ [-Wimplicit-int] main.c:5:1: warning: type of ‘used’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:16:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 16 | main(){ | ^~~~ main.c: In function ‘main’: main.c:17:1: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 17 | gets(s); | ^~~~ main.c:19:1: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 19 | printf("%d",ans); | ^~~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ +++ |+#include <stdio.h> 1 | #define max(p,q)p<q?p=q:0 main.c:19:1: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] 19 | printf("%d",ans); | ^~~~~~ main.c:19:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ /usr/bin/ld: /tmp/cciiy0AZ.o: in function `main': main.c:(.text.startup+0x12): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#define max(p,q)p<q?p=q:0 char s[99]; ans; f(sum,used){ int i,j,k,newsum; for(i=0;s[i];i++){if(used>>i&1||s[i]=='0')continue; for(j=i+1;s[j];j++){if(used>>j&1||s[i]==s[j])continue; for(k=j+1;s[k];k++){if(used>>k&1||s[j]!=s[k])continue; newsum=sum+(s[i]-'0')*100+(s[j]-'0')*10+s[k]-'0'; max(ans,newsum); f(newsum,used^1<<i^1<<j^1<<k); }}} } main(){ gets(s); f(0,0); printf("%d",ans); return 0; }