結果

問題 No.482 あなたの名は
ユーザー ototonariototonari
提出日時 2017-03-21 19:47:43
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,322 bytes
コンパイル時間 2,039 ms
コンパイル使用メモリ 104,252 KB
実行使用メモリ 23,012 KB
最終ジャッジ日時 2023-09-18 15:35:11
合計ジャッジ時間 8,344 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
23,012 KB
testcase_01 AC 59 ms
20,732 KB
testcase_02 AC 59 ms
18,668 KB
testcase_03 AC 58 ms
18,676 KB
testcase_04 AC 59 ms
20,824 KB
testcase_05 AC 59 ms
22,820 KB
testcase_06 AC 59 ms
20,772 KB
testcase_07 AC 67 ms
21,016 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 66 ms
18,876 KB
testcase_11 AC 67 ms
20,968 KB
testcase_12 AC 67 ms
20,972 KB
testcase_13 AC 68 ms
22,944 KB
testcase_14 AC 66 ms
21,144 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            string[] t = Console.ReadLine().Split(' ');
            long K = long.Parse(s[1]);
            long C = 0;
            long[] p = new long[long.Parse(s[0])];
            for (int i = 0; i < t.Length; i++) p[i] = long.Parse(t[i]);
            for (int i = 0; i < p.Length; i++)
            {
                long min = p[i];
                long index = 0;
                for (int j = i;j < p.Length; j++)
                {
                    if(min > p[j])
                    {
                        min = p[j];
                        index = j;
                    }
                }

                if(p[i] != min)
                {
                    long tmp = p[i];
                    p[i] = p[index];
                    p[index] = tmp;
                    C++;
                }
            }
            if((K - C) % 2 == 0)
            {
                Console.WriteLine("{0}", "YES");
            }
            else
            {
                Console.WriteLine("{0}", "NO");
            }
            
            
            //Console.ReadLine();
        }
    }
}
0