結果
| 問題 |
No.2052 Indegree
|
| コンテスト | |
| ユーザー |
bluemegane
|
| 提出日時 | 2022-08-27 10:00:11 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 661 bytes |
| コンパイル時間 | 2,137 ms |
| コンパイル使用メモリ | 106,112 KB |
| 実行使用メモリ | 18,816 KB |
| 最終ジャッジ日時 | 2024-10-14 08:41:29 |
| 合計ジャッジ時間 | 3,668 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System;
public class Hello
{
static void Main()
{
string[] line = Console.ReadLine().Trim().Split(' ');
var n = int.Parse(line[0]);
var m = int.Parse(line[1]);
getAns(n,m);
}
static void getAns(int n, int m)
{
var from = new bool[n];
for (int i = 0; i < m; i++)
{
string[] line = Console.ReadLine().Trim().Split(' ');
var w = int.Parse(line[1]) - 1;
from[w] = true;
}
var ans = from.Count(x => x == false);
Console.WriteLine(ans);
}
}
bluemegane