結果
問題 | No.698 ペアでチームを作ろう |
ユーザー | tails |
提出日時 | 2018-06-09 17:30:26 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 161 ms / 1,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 29,952 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 12:37:31 |
合計ジャッジ時間 | 2,393 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 11 ms
5,376 KB |
testcase_05 | AC | 159 ms
5,376 KB |
testcase_06 | AC | 158 ms
5,376 KB |
testcase_07 | AC | 154 ms
5,376 KB |
testcase_08 | AC | 160 ms
5,376 KB |
testcase_09 | AC | 156 ms
5,376 KB |
testcase_10 | AC | 159 ms
5,376 KB |
testcase_11 | AC | 156 ms
5,376 KB |
testcase_12 | AC | 159 ms
5,376 KB |
testcase_13 | AC | 161 ms
5,376 KB |
testcase_14 | AC | 160 ms
5,376 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | n;a[14];d[1<<14]; | ^ main.c:1:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:1:3: warning: data definition has no type or storage class 1 | n;a[14];d[1<<14]; | ^ main.c:1:3: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:9: warning: data definition has no type or storage class 1 | n;a[14];d[1<<14]; | ^ main.c:1:9: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int] 2 | main(i,j,c,u){ | ^~~~ main.c: In function 'main': main.c:2:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:2:1: warning: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:2:1: warning: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:2:1: warning: type of 'u' defaults to 'int' [-Wimplicit-int] main.c:3:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | n;a[14];d[1<<14]; main.c:3:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | scanf("%d",&n); | ^~~~~ main.c:3:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:10:27: warning: implicit declaration of function 'ffs' [-Wimplicit-function-declaration] 10 | i=ffs(u)-1; | ^~~ main.c:24:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 24 | printf("%d",d[(1<<n)-1]); | ^~~~~~ main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:24:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbui
ソースコード
n;a[14];d[1<<14]; main(i,j,c,u){ scanf("%d",&n); for(i=0;i<n;++i){ scanf("%d",&a[i]); } for(u=0;u<1<<n;++u){ c=__builtin_popcount(u); if(c==2){ i=ffs(u)-1; j=ffs(u&u-1)-1; d[u]=a[i]^a[j]; }else{ for(i=1;i<u;++i){ if((u&i)==i){ j=u^i; if(d[u]<d[i]+d[j]){ d[u]=d[i]+d[j]; } } } } } printf("%d",d[(1<<n)-1]); }