結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,380 KB
testcase_01 AC 44 ms
49,444 KB
testcase_02 WA -
testcase_03 AC 43 ms
49,416 KB
testcase_04 AC 43 ms
49,232 KB
testcase_05 WA -
testcase_06 AC 44 ms
49,768 KB
testcase_07 WA -
testcase_08 AC 48 ms
49,636 KB
testcase_09 AC 45 ms
49,388 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 49 ms
49,340 KB
testcase_15 AC 248 ms
64,484 KB
testcase_16 AC 269 ms
65,440 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 256 ms
64,420 KB
testcase_20 WA -
testcase_21 AC 270 ms
64,508 KB
testcase_22 AC 274 ms
65,944 KB
testcase_23 AC 262 ms
64,424 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 262 ms
65,844 KB
testcase_28 AC 271 ms
64,712 KB
testcase_29 WA -
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&&(K-cnt)%2==0?"YES":"NO");
    }
}
0