結果
問題 | No.130 XOR Minimax |
ユーザー | %20 |
提出日時 | 2017-09-11 17:59:59 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 35 ms / 5,000 ms |
コード長 | 261 bytes |
コンパイル時間 | 217 ms |
コンパイル使用メモリ | 30,208 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-12 22:49:54 |
合計ジャッジ時間 | 1,455 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 18 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,940 KB |
testcase_02 | AC | 1 ms
6,944 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | AC | 15 ms
6,940 KB |
testcase_05 | AC | 19 ms
6,940 KB |
testcase_06 | AC | 18 ms
6,944 KB |
testcase_07 | AC | 20 ms
6,944 KB |
testcase_08 | AC | 30 ms
6,940 KB |
testcase_09 | AC | 5 ms
6,944 KB |
testcase_10 | AC | 7 ms
6,944 KB |
testcase_11 | AC | 24 ms
6,940 KB |
testcase_12 | AC | 3 ms
6,940 KB |
testcase_13 | AC | 19 ms
6,940 KB |
testcase_14 | AC | 35 ms
6,944 KB |
testcase_15 | AC | 1 ms
6,940 KB |
testcase_16 | AC | 25 ms
6,944 KB |
testcase_17 | AC | 26 ms
6,944 KB |
testcase_18 | AC | 28 ms
6,940 KB |
testcase_19 | AC | 33 ms
6,940 KB |
testcase_20 | AC | 16 ms
6,940 KB |
testcase_21 | AC | 35 ms
6,944 KB |
testcase_22 | AC | 8 ms
6,944 KB |
testcase_23 | AC | 3 ms
6,940 KB |
コンパイルメッセージ
main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int] 2 | c(int*a,int*b){return*a-*b;} | ^ main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int] 3 | f(s,l,r,m){ | ^ main.c: In function 'f': main.c:3:1: warning: type of 's' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'l' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'r' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:5:39: warning: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 5 | return s<0?0:m-l&&m-r?1<<s|(i=fmin(f(s-1,l,m),f(s-1,m,r))):f(s-1,l,r); | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmin' +++ |+#include <math.h> 1 | int N,a[100000],i; main.c:5:39: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] 5 | return s<0?0:m-l&&m-r?1<<s|(i=fmin(f(s-1,l,m),f(s-1,m,r))):f(s-1,l,r); | ^~~~ main.c:5:39: note: include '<math.h>' or provide a declaration of 'fmin' main.c: At top level: main.c:7:1: warning: return type defaults to 'int' [-Wimplicit-int] 7 | main(){ | ^~~~ main.c: In function 'main': main.c:8:13: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 8 | for(scanf("%d",&N);~scanf("%d",a+i++);); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int N,a[100000],i; main.c:8:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 8 | for(scanf("%d",&N);~scanf("%d",a+i++);); | ^~~~~ main.c:8:13: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:9:9: warning: implicit declaration of function 'qsort' [-Wimplici
ソースコード
int N,a[100000],i; c(int*a,int*b){return*a-*b;} f(s,l,r,m){ for(m=l;m<r&&!(a[m]&1<<s);++m); return s<0?0:m-l&&m-r?1<<s|(i=fmin(f(s-1,l,m),f(s-1,m,r))):f(s-1,l,r); } main(){ for(scanf("%d",&N);~scanf("%d",a+i++);); qsort(a,N,4,c); printf("%d",f(29,0,N)); }