結果

問題 No.130 XOR Minimax
ユーザー %20%20
提出日時 2017-09-11 16:59:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 2,066 ms
コンパイル使用メモリ 197,072 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 06:46:04
合計ジャッジ時間 4,310 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 18 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 37 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 91 ms
5,376 KB
testcase_09 AC 7 ms
5,376 KB
testcase_10 AC 12 ms
5,376 KB
testcase_11 AC 34 ms
5,376 KB
testcase_12 AC 5 ms
5,376 KB
testcase_13 AC 26 ms
5,376 KB
testcase_14 AC 72 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 52 ms
5,376 KB
testcase_17 AC 54 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 70 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 69 ms
5,376 KB
testcase_22 AC 17 ms
5,376 KB
testcase_23 AC 6 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int a[100001],i;
int f(int s,int l,int r){
	return s<0?0:(i=lower_bound(a+l,a+r,a[l]&-(1<<s)|1<<s)-a)-l&&i-r?1<<s|min(f(s-1,l,i),f(s-1,i,r)):f(s-1,l,r);
}
main(){
	for(;cin>>a[i++];);
	sort(a+1,a+i);
	cout<<f(29,1,i);
}
0