結果

問題 No.482 あなたの名は
ユーザー ototonariototonari
提出日時 2017-03-22 22:52:42
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 703 bytes
コンパイル時間 2,378 ms
コンパイル使用メモリ 100,716 KB
実行使用メモリ 41,360 KB
最終ジャッジ日時 2023-09-19 05:26:24
合計ジャッジ時間 6,947 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,780 KB
testcase_01 AC 58 ms
20,764 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 57 ms
22,708 KB
testcase_05 AC 57 ms
20,768 KB
testcase_06 AC 57 ms
20,644 KB
testcase_07 AC 65 ms
20,884 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 64 ms
22,976 KB
testcase_11 WA -
testcase_12 AC 65 ms
20,932 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 127 ms
39,168 KB
testcase_17 AC 128 ms
39,292 KB
testcase_18 WA -
testcase_19 AC 129 ms
37,208 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 129 ms
37,232 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 128 ms
39,352 KB
testcase_29 AC 127 ms
39,172 KB
testcase_30 AC 57 ms
20,748 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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();
        }
    }

}
0