結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
fiord
|
| 提出日時 | 2017-02-27 07:45:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 314 bytes |
| 記録 | |
| コンパイル時間 | 1,656 ms |
| コンパイル使用メモリ | 165,568 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 19:01:07 |
| 合計ジャッジ時間 | 3,698 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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