2019年11月10日19時11分10秒に更新されたバージョンを表示しています.
最新のページはこちらをご覧ください.
Codeforces Global Round 5 C1問題 (750pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, X[5d4], Y[5d4], Z[5d4], ind[5d4];
int ress, res1[5d4], res2[5d4];
{
int k;
rd(N,(X,Y,Z)(N));
rep(i,N) ind[i] = i + 1;
sortA(N, X, Y, Z, ind);
rep(i,1,N) if(X[i]==X[i-1] && Y[i]==Y[i-1] && ind[i] >= 0 && ind[i-1] >= 0){
arrInsert(ress, ress, res1, ind[i-1], res2, ind[i]);
ind[i-1] = ind[i] = -1;
}
k = N;
N = 0;
rep(i,k) if(ind[i] >= 0){
X[N] = X[i];
Y[N] = Y[i];
ind[N] = ind[i];
N++;
}
rep(i,1,N) if(X[i]==X[i-1] && ind[i] >= 0 && ind[i-1] >= 0){
arrInsert(ress, ress, res1, ind[i-1], res2, ind[i]);
ind[i-1] = ind[i] = -1;
}
k = N;
N = 0;
rep(i,k) if(ind[i] >= 0){
X[N] = X[i];
ind[N] = ind[i];
N++;
}
rep(i,1,N) if(ind[i] >= 0 && ind[i-1] >= 0){
arrInsert(ress, ress, res1, ind[i-1], res2, ind[i]);
ind[i-1] = ind[i] = -1;
}
rep(i,ress) wt(res1[i], res2[i]);
}
Current time: 2024年05月11日21時11分12秒
Last modified: 2019年11月10日19時11分10秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces Codeforces_Global_Round_5
トップページに戻る
Logged in as: unknown user (not login)