結果
問題 |
No.482 あなたの名は
|
ユーザー |
|
提出日時 | 2017-03-22 22:52:42 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 703 bytes |
コンパイル時間 | 1,255 ms |
コンパイル使用メモリ | 103,680 KB |
実行使用メモリ | 34,432 KB |
最終ジャッジ日時 | 2024-07-05 17:48:38 |
合計ジャッジ時間 | 4,110 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 13 WA * 15 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace yukicoder { class Program { static void Main() { string[] s = Console.ReadLine().Split(' '); string[] t = Console.ReadLine().Split(' '); long K = long.Parse(s[1]); long C = 0; for (int i = 0; i < t.Length; i++) { if (long.Parse(t[i]) != i + 1) C++; } if(C % 3 == 0) { C = (C / 2) + 1; } else { C /= 2; } Console.WriteLine((K - C) % 2 == 0 ? "YES" : "NO"); Console.ReadLine(); } } }