結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
fiord
|
| 提出日時 | 2017-02-27 07:45:55 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 314 bytes |
| 記録 | |
| コンパイル時間 | 883 ms |
| コンパイル使用メモリ | 179,984 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-25 16:39:03 |
| 合計ジャッジ時間 | 2,895 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 17 WA * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n,k; cin>>n>>k;
ll diff=0,same=0;
for(int i=0;i<n;i++){
int a; cin>>a;
if(a==i+1) same++;
else diff++;
}
if(diff>k+1) cout<<"NO"<<endl;
else if((k+1-diff)%2==0) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
}
fiord