結果
問題 |
No.482 あなたの名は
|
ユーザー |
|
提出日時 | 2017-03-22 22:54:55 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 713 bytes |
コンパイル時間 | 920 ms |
コンパイル使用メモリ | 103,936 KB |
実行使用メモリ | 34,432 KB |
最終ジャッジ日時 | 2024-07-05 17:48:47 |
合計ジャッジ時間 | 3,900 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 14 |
コンパイルメッセージ
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 != 0 && C % 3 == 0) { C = (C / 2) + 1; } else { C /= 2; } Console.WriteLine((K - C) % 2 == 0 ? "YES" : "NO"); Console.ReadLine(); } } }