結果
問題 |
No.482 あなたの名は
|
ユーザー |
![]() |
提出日時 | 2017-02-10 22:37:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 407 bytes |
コンパイル時間 | 1,567 ms |
コンパイル使用メモリ | 157,652 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-28 07:42:11 |
合計ジャッジ時間 | 3,303 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 13 |
ソースコード
#include "bits/stdc++.h" using namespace std; const char en = '\n'; using ll = long long; using ull = unsigned long long; int main(){ ios::sync_with_stdio(false);cin.tie(); int n,ar[200000]; ll k; cin>>n>>k; for(int i=0;i<n;i++){ cin>>ar[i]; ar[i]--; } for(int i=0;i<n;i++){ if(i!=ar[i]){ swap(ar[ar[i]],ar[i]); k--; } } cout<<((k%2==0)?"YES":"NO")<<en; return 0; }