結果

問題 No.482 あなたの名は
ユーザー yun_appyun_app
提出日時 2017-03-14 17:23:15
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 802 bytes
コンパイル時間 2,161 ms
コンパイル使用メモリ 72,772 KB
実行使用メモリ 66,552 KB
最終ジャッジ日時 2023-09-12 12:22:25
合計ジャッジ時間 8,624 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,364 KB
testcase_01 AC 44 ms
49,064 KB
testcase_02 AC 43 ms
49,328 KB
testcase_03 AC 44 ms
49,060 KB
testcase_04 AC 44 ms
49,060 KB
testcase_05 WA -
testcase_06 AC 44 ms
49,140 KB
testcase_07 AC 51 ms
49,352 KB
testcase_08 WA -
testcase_09 AC 45 ms
49,092 KB
testcase_10 AC 48 ms
49,220 KB
testcase_11 AC 48 ms
49,316 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 258 ms
64,556 KB
testcase_16 WA -
testcase_17 AC 271 ms
64,996 KB
testcase_18 WA -
testcase_19 AC 265 ms
64,844 KB
testcase_20 AC 272 ms
64,656 KB
testcase_21 AC 265 ms
66,552 KB
testcase_22 AC 265 ms
64,532 KB
testcase_23 AC 269 ms
64,444 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 272 ms
64,524 KB
testcase_27 AC 261 ms
64,836 KB
testcase_28 WA -
testcase_29 AC 279 ms
64,948 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&&(K-cnt)%2==0?"YES":"NO");
    }
}
0