結果

問題 No.482 あなたの名は
ユーザー Naoyk1212
提出日時 2017-02-10 22:58:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 1,444 ms
コンパイル使用メモリ 157,784 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-28 09:02:25
合計ジャッジ時間 3,746 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 << "NO" << endl;
	else cout << "YES" << endl;
}
0