結果
問題 | No.130 XOR Minimax |
ユーザー | 👑 testestest |
提出日時 | 2015-12-02 22:36:47 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 25 ms / 5,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 112 ms |
コンパイル使用メモリ | 20,736 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-12 22:36:46 |
合計ジャッジ時間 | 1,384 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 13 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,940 KB |
testcase_02 | AC | 1 ms
6,940 KB |
testcase_03 | AC | 0 ms
6,940 KB |
testcase_04 | AC | 12 ms
6,940 KB |
testcase_05 | AC | 17 ms
6,940 KB |
testcase_06 | AC | 16 ms
6,944 KB |
testcase_07 | AC | 19 ms
6,940 KB |
testcase_08 | AC | 20 ms
6,940 KB |
testcase_09 | AC | 4 ms
6,944 KB |
testcase_10 | AC | 6 ms
6,944 KB |
testcase_11 | AC | 22 ms
6,940 KB |
testcase_12 | AC | 2 ms
6,944 KB |
testcase_13 | AC | 17 ms
6,944 KB |
testcase_14 | AC | 25 ms
6,944 KB |
testcase_15 | AC | 1 ms
6,940 KB |
testcase_16 | AC | 18 ms
6,944 KB |
testcase_17 | AC | 18 ms
6,940 KB |
testcase_18 | AC | 20 ms
6,940 KB |
testcase_19 | AC | 24 ms
6,940 KB |
testcase_20 | AC | 12 ms
6,944 KB |
testcase_21 | AC | 25 ms
6,940 KB |
testcase_22 | AC | 5 ms
6,944 KB |
testcase_23 | AC | 2 ms
6,944 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | a[100000]; | ^ main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | c(int*a,int*b){return*a-*b;} | ^ main.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 4 | x(int*a,int n,int i){ | ^ main.c:12:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 12 | main(n){ | ^~~~ main.c: In function ‘main’: main.c:12:1: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int] main.c:13:11: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 13 | for(n=-2;~scanf("%d",++n+a);); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | a[100000]; main.c:13:11: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 13 | for(n=-2;~scanf("%d",++n+a);); | ^~~~~ main.c:13:11: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:14:1: warning: implicit declaration of function ‘qsort’ [-Wimplicit-function-declaration] 14 | qsort(a,n,4,c); | ^~~~~ main.c:15:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 15 | return !printf("%d",x(a,n,29)); | ^~~~~~ main.c:15:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:15:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:15:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
a[100000]; c(int*a,int*b){return*a-*b;} x(int*a,int n,int i){ if(i==-1)return 0; if(~(*a^a[n-1])>>i&1)return x(a,n,i-1); int l=0,u=n,m; for(;u-l>1;a[m=(l+u)/2]>>i&1?u=m:(l=m)); return 1<<i|(l=x(a,u,i-1),l<(m=x(a+u,n-u,i-1))?l:m); } main(n){ for(n=-2;~scanf("%d",++n+a);); qsort(a,n,4,c); return !printf("%d",x(a,n,29)); }