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