2020年11月22日16時51分49秒に更新されたバージョンを表示しています.
最新のページはこちらをご覧ください.
Codeforces Round #685 DIV2 E1問題 (1500pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//interactive
int N;
int arr[1d6], fn[1d6];
int res[1d6], tmp[1d6];
{
int x, y, mask, k;
rd(N);
rep(i,1,N){
wt("XOR", 1, i+1);
rd(arr[i]);
}
rep(loop,2){
mask = if[loop==0, 1, N-2];
rep(i,N) fn[i] = -1;
rep(i,N){
if(fn[arr[i]&mask] >= 0){
(x, y) = (fn[arr[i]&mask], i);
wt("AND", x+1, y+1);
k = (rd_int() & mask);
res[x] |= k;
res[y] |= k;
if(x != 0 && y != 0) res[0] |= ((arr[x]^res[x]) & mask);
rep(i,1,N) if(i!=x && i!=y) res[i] |= ((arr[i]^res[0]) & mask);
break;
}
fn[arr[i]&mask] = i;
}
}
wt("!",res(N));
}
Current time: 2024年05月03日07時45分34秒
Last modified: 2020年11月22日16時51分49秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF685 CF_DIV2_E
トップページに戻る
Logged in as: unknown user (not login)