結果

問題 No.482 あなたの名は
ユーザー Naoyk1212
提出日時 2017-02-10 23:00:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 1,430 ms
コンパイル使用メモリ 158,592 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-28 09:05:52
合計ジャッジ時間 3,585 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
	int n, k;
	cin >> n >> k;
	int num = 0;
	int a;
	for(int i = 1; i <= n; i++){
		cin >> a;
		if(a != i) num++;
	}
	num = (num + 1) / 2;
	k -= num;
	if(k >= 0 && k % 2 == 0) cout << "YES" << endl;
	else cout << "NO" << endl;
}
0