結果

問題 No.519 アイドルユニット
ユーザー cielciel
提出日時 2017-05-29 21:39:39
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 293 bytes
コンパイル時間 631 ms
コンパイル使用メモリ 29,988 KB
実行使用メモリ 21,032 KB
最終ジャッジ日時 2023-10-21 16:57:19
合計ジャッジ時間 5,149 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | r[1<<24],m[24][24],n;
      | ^
main.c:1:1: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
main.c:1:10: warning: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
    1 | r[1<<24],m[24][24],n;
      |          ^
main.c:1:20: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
    1 | r[1<<24],m[24][24],n;
      |                    ^
main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         scanf("%d",&n);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | r[1<<24],m[24][24],n;
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         scanf("%d",&n);
      |         ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    7 |         printf("%d\n",r[(1<<n)-1]);
      |         ^~~~~~
main.c:7:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:9: note: include '<stdio.h>' or provide a declaration of 'printf'

ソースコード

diff #

r[1<<24],m[24][24],n;
main(){
	int i,j,k,t,s;
	scanf("%d",&n);
	for(i=0;i<n;i++)for(j=0;j<n;j++)scanf("%d",m[i]+j);
	for(i=0;i<1<<n;i++)if(!__builtin_parity(i))for(j=0;j<n;j++)for(k=0;k<n;k++)if(!(i&1<<j)&&!(i&1<<k))if(t=i|1<<j|1<<k,s=r[i]+m[j][k],r[t]<s)r[t]=s;
	printf("%d\n",r[(1<<n)-1]);
}
0