結果

問題 No.482 あなたの名は
ユーザー yun_appyun_app
提出日時 2017-03-14 17:20:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 794 bytes
コンパイル時間 2,400 ms
コンパイル使用メモリ 72,140 KB
実行使用メモリ 65,884 KB
最終ジャッジ日時 2023-09-12 12:21:56
合計ジャッジ時間 9,048 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,176 KB
testcase_01 AC 44 ms
49,324 KB
testcase_02 AC 44 ms
49,440 KB
testcase_03 AC 44 ms
49,480 KB
testcase_04 AC 44 ms
49,132 KB
testcase_05 WA -
testcase_06 AC 44 ms
49,328 KB
testcase_07 AC 51 ms
49,340 KB
testcase_08 WA -
testcase_09 AC 45 ms
49,236 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 266 ms
65,308 KB
testcase_16 WA -
testcase_17 AC 271 ms
64,536 KB
testcase_18 WA -
testcase_19 AC 272 ms
64,868 KB
testcase_20 AC 267 ms
64,104 KB
testcase_21 AC 297 ms
65,160 KB
testcase_22 AC 291 ms
65,884 KB
testcase_23 AC 265 ms
64,308 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 296 ms
65,456 KB
testcase_27 AC 266 ms
64,368 KB
testcase_28 WA -
testcase_29 AC 276 ms
64,336 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] lines = br.readLine().split(" ");
        int N = Integer.parseInt(lines[0]);
        long K = Long.parseLong(lines[1]);
        
        long cnt = 0;
        lines = br.readLine().split(" ");
        for(int i=1;i<=N;i++){
            if(i > Integer.parseInt(lines[i-1])){
                cnt++;
            }
        }
        
        System.out.println((K-cnt)%2==0?"YES":"NO");
    }
}
0