結果
| 問題 | No.3499 I Love DAG |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 18:12:31 |
| 言語 | C (gcc 15.3.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 345 ms / 2,000 ms |
| + 3µs | |
| コード長 | 551 bytes |
| 記録 | |
| コンパイル時間 | 170 ms |
| コンパイル使用メモリ | 34,816 KB |
| 実行使用メモリ | 6,400 KB |
| 平均クエリ数 | 18782.41 |
| 最終ジャッジ日時 | 2026-09-08 18:22:11 |
| 合計ジャッジ時間 | 11,587 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 40 |
ソースコード
#include <stdio.h>
int main(void) {
int N, M;
scanf("%d %d", &N, &M);
for (int i = 0; i < M; i++) {
int A, B;
scanf("%d %d", &A, &B);
/* Use vertex number as fixed topological order.
Always direct the edge from the lower-numbered to higher-numbered vertex.
Since every edge goes "upward" in this ordering, no cycle is possible. */
if (A < B)
printf("0\n"); /* A -> B */
else
printf("1\n"); /* B -> A */
fflush(stdout);
}
return 0;
}