結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
fiord
|
| 提出日時 | 2017-02-27 07:35:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 327 bytes |
| 記録 | |
| コンパイル時間 | 1,367 ms |
| コンパイル使用メモリ | 166,908 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-11 19:00:55 |
| 合計ジャッジ時間 | 3,812 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 28 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k; cin>>n>>k;
int 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 if(n>3) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}
fiord