結果

問題 No.482 あなたの名は
ユーザー tsutajtsutaj
提出日時 2017-02-11 21:57:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,649 bytes
コンパイル時間 1,462 ms
コンパイル使用メモリ 94,836 KB
実行使用メモリ 5,084 KB
最終ジャッジ日時 2023-08-28 14:46:52
合計ジャッジ時間 3,646 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,880 KB
testcase_01 AC 2 ms
4,784 KB
testcase_02 AC 2 ms
4,952 KB
testcase_03 AC 3 ms
4,960 KB
testcase_04 AC 3 ms
4,852 KB
testcase_05 WA -
testcase_06 AC 3 ms
4,888 KB
testcase_07 AC 3 ms
5,028 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 3 ms
4,828 KB
testcase_11 AC 3 ms
4,960 KB
testcase_12 AC 3 ms
4,976 KB
testcase_13 AC 3 ms
4,944 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 57 ms
4,828 KB
testcase_17 AC 57 ms
4,788 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 57 ms
4,888 KB
testcase_25 AC 57 ms
4,864 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 58 ms
4,928 KB
testcase_29 AC 56 ms
4,976 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

signed main() {
    int n, k; cin >> n >> k;
    int d[200010] = {};
    rep(i,0,n) cin >> d[i];

    int cnt = 0;
    rep(i,0,n) {
        if(d[i] != i+1) cnt++;
    }
    cnt /= 2;
    if(cnt % 2 == k % 2) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}
0