Educational Codeforces Round 72 D問題
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, M, A[5000], B[5000];
int d[5000];
{
int res;
graph g;
rd(N,M,(A--,B--)(M));
g.setDirectEdge(N,M,A,B);
res = g.TopologicalSort(d);
if(res){
res = 1;
rep(i,M) d[i] = 1;
} else {
res = 2;
rep(i,M) d[i] = if[A[i] < B[i], 1, 2];
}
wt(res);
wt(d(M));
}
Current time: 2024年04月19日17時05分38秒
Last modified: 2019年09月15日13時18分52秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る
Logged in as: unknown user (not login)