結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-15 22:26:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 332 bytes |
| 記録 | |
| コンパイル時間 | 1,579 ms |
| コンパイル使用メモリ | 166,584 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-26 06:23:13 |
| 合計ジャッジ時間 | 3,695 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 13 |
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
long long k;
cin >> n >> k;
int cnt = 0;
for(int i = 1; i <= n; i++) {
int x;
cin >> x;
cnt += x != i;
}
cnt /= 2;
k -= cnt;
puts(k >= 0 && !(k & 1) ? "YES" : "NO");
return 0;
}