結果
問題 | No.519 アイドルユニット |
ユーザー | tails |
提出日時 | 2017-05-28 22:58:59 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 970 ms / 1,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 1,240 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 67,328 KB |
最終ジャッジ日時 | 2024-12-05 07:37:41 |
合計ジャッジ時間 | 8,638 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 755 ms
18,176 KB |
testcase_01 | AC | 960 ms
67,328 KB |
testcase_02 | AC | 224 ms
18,176 KB |
testcase_03 | AC | 13 ms
5,248 KB |
testcase_04 | AC | 1 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 1 ms
5,248 KB |
testcase_08 | AC | 2 ms
5,248 KB |
testcase_09 | AC | 2 ms
5,248 KB |
testcase_10 | AC | 4 ms
5,248 KB |
testcase_11 | AC | 14 ms
5,248 KB |
testcase_12 | AC | 1 ms
5,248 KB |
testcase_13 | AC | 14 ms
5,248 KB |
testcase_14 | AC | 14 ms
5,248 KB |
testcase_15 | AC | 14 ms
5,248 KB |
testcase_16 | AC | 14 ms
5,248 KB |
testcase_17 | AC | 13 ms
5,248 KB |
testcase_18 | AC | 13 ms
5,248 KB |
testcase_19 | AC | 14 ms
5,248 KB |
testcase_20 | AC | 14 ms
5,248 KB |
testcase_21 | AC | 14 ms
5,248 KB |
testcase_22 | AC | 14 ms
5,248 KB |
testcase_23 | AC | 14 ms
5,248 KB |
testcase_24 | AC | 55 ms
5,888 KB |
testcase_25 | AC | 54 ms
5,888 KB |
testcase_26 | AC | 54 ms
5,888 KB |
testcase_27 | AC | 54 ms
5,888 KB |
testcase_28 | AC | 57 ms
5,888 KB |
testcase_29 | AC | 950 ms
67,328 KB |
testcase_30 | AC | 970 ms
67,328 KB |
testcase_31 | AC | 918 ms
67,328 KB |
testcase_32 | AC | 942 ms
67,328 KB |
testcase_33 | AC | 1 ms
5,248 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | f[24][24]; | ^ main.c:1:1: warning: type defaults to 'int' in declaration of 'f' [-Wimplicit-int] main.c:2:1: warning: data definition has no type or storage class 2 | g[1<<24]; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'g' [-Wimplicit-int] main.c:3:1: warning: data definition has no type or storage class 3 | d,i,j,k,n; | ^ main.c:3:1: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] main.c:3:3: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 3 | d,i,j,k,n; | ^ main.c:3:5: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 3 | d,i,j,k,n; | ^ main.c:3:7: warning: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 3 | d,i,j,k,n; | ^ main.c:3:9: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 3 | d,i,j,k,n; | ^ main.c:4:1: warning: return type defaults to 'int' [-Wimplicit-int] 4 | main(){ | ^~~~ main.c: In function 'main': main.c:5:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | f[24][24]; main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d",&n); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:13:33: warning: implicit declaration of function 'ffs' [-Wimplicit-function-declaration] 13 | for(i=j=ffs(k)-1;++i<n;){ | ^~~ main.c:21:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 21 | printf("%d",g[(1<<n)-1]); | ^~~~~
ソースコード
f[24][24]; g[1<<24]; d,i,j,k,n; main(){ scanf("%d",&n); for(j=0;j<n;++j){ for(i=0;i<n;++i){ scanf("%d",&f[j][i]); } } for(k=1;k<1<<n;++k){ if(!__builtin_parity(k)){ for(i=j=ffs(k)-1;++i<n;){ if(k&1<<i){ d=g[k^1<<j^1<<i]+f[j][i]; if(g[k]<d)g[k]=d; } } } } printf("%d",g[(1<<n)-1]); }