結果
問題 | No.482 あなたの名は |
ユーザー | Mackyson |
提出日時 | 2018-01-04 00:08:31 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 496 bytes |
コンパイル時間 | 742 ms |
コンパイル使用メモリ | 73,204 KB |
実行使用メモリ | 4,508 KB |
最終ジャッジ日時 | 2023-08-24 18:07:00 |
合計ジャッジ時間 | 3,302 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,384 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 2 ms
4,384 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 2 ms
4,380 KB |
testcase_10 | AC | 2 ms
4,380 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 56 ms
4,376 KB |
testcase_22 | AC | 56 ms
4,384 KB |
testcase_23 | WA | - |
testcase_24 | AC | 56 ms
4,384 KB |
testcase_25 | WA | - |
testcase_26 | AC | 56 ms
4,384 KB |
testcase_27 | AC | 55 ms
4,376 KB |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <cstdio> #include <string> #include <map> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define INF 100000007 int main() { int n,cnt=0; long long int k; cin >> n >> k; vector<bool> isChecked(n); vector<int>d(n); rep(i, n) cin >> d[i]; rep(i, n) { if (d[i] != i) { if (d[d[i]-1] == i) cnt+=2; else cnt++; } } string s = (k - cnt) % 2 ? "NO" : "YES"; cout << s << endl; }