結果
| 問題 | No.2052 Indegree |
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2022-08-21 12:50:08 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 451 bytes |
| 記録 | |
| コンパイル時間 | 2,369 ms |
| コンパイル使用メモリ | 85,448 KB |
| 実行使用メモリ | 42,316 KB |
| 最終ジャッジ日時 | 2026-04-26 08:31:31 |
| 合計ジャッジ時間 | 4,762 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] c = new int[n];
for (int i = 0; i < m; i++) {
sc.nextInt();
int b = sc.nextInt() - 1;
c[b]++;
}
sc.close();
int ans = 0;
for (int i = 0; i < c.length; i++) {
if (c[i] == 0) {
ans++;
}
}
System.out.println(ans);
}
}
ks2m