結果
問題 |
No.482 あなたの名は
|
ユーザー |
![]() |
提出日時 | 2017-02-10 22:55:02 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 415 bytes |
コンパイル時間 | 583 ms |
コンパイル使用メモリ | 58,764 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-28 08:55:21 |
合計ジャッジ時間 | 2,748 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 13 |
ソースコード
#include<iostream> #include<vector> #include<string> using namespace std; #define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++) #define rep(i,n) FOR((i),0,(n)) typedef long long ll; const int INF=1e9+7; const int MAX_N=2*1e5+5; int main(){ ll n,k; cin>>n>>k; ll ans=0; rep(i,n){ int a; cin>>a; if(a!=i+1)ans++; } ans=ans/2+(ans%2); if(k-ans>=0 && (k-ans)!=1)cout<<"YES"<<endl; else cout<<"NO"<<endl; }