Codeforces Round #693 DIV3 F問題
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, M, R[2d5], C[2d5];
{
REP(rd_int()){
rd(N,M,(R--,C--)(M));
if(M%2) wt("NO"), continue;
sortA(M,C,R);
while(M){
if(C[M-1] == C[M-2]) M-=2, continue;
if(M >= 3 && C[M-2]==C[M-3]) wt("NO"), break_continue;
if(C[M-1] == C[M-2]+1){
if(R[M-1] == R[M-2]) M-=2, continue;
wt("NO"), break_continue;
}
R[M-1] ^= (C[M-1] - C[M-2] - 1) % 2;
C[M-1] = C[M-2] + 1;
}
wt("YES");
}
}
Current time: 2024年04月24日12時30分36秒
Last modified: 2021年01月05日22時03分43秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF693 CF_DIV3_F
トップページに戻る
Logged in as: unknown user (not login)