結果

問題 No.1717 Levi-Civita Triangle
ユーザー ktr216ktr216
提出日時 2021-10-22 23:33:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 1,784 ms
コンパイル使用メモリ 169,712 KB
実行使用メモリ 4,928 KB
最終ジャッジ日時 2023-10-24 15:44:50
合計ジャッジ時間 3,198 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 4 ms
4,348 KB
testcase_07 AC 21 ms
4,392 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 5 ms
4,348 KB
testcase_12 AC 13 ms
4,348 KB
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 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
4,348 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, l, r) for (int i = (l); i < (r); i++)
using namespace std;

typedef long long ll;

int main() {
    int N;
    cin >> N;
    vector<int> A(2 * N + 1), B(2 * N - 1, 0);
    rep(i, 0, 2 * N + 1) cin >> A[i];
    rep(i, 0, 2 * N - 1) {
        if (A[i + 1] == (A[i] + 1) % 3 && A[i + 2] == (A[i] + 2) % 3) B[i] = 1;
        if (A[i + 1] == (A[i] + 2) % 3 && A[i + 2] == (A[i] + 1) % 3) B[i] = 2;
    }
    //rep(i, 0, 2 * N - 1) cout << B[i] << " "; cout << endl;
    bool f = true;
    rep(i, 0, 2 * N - 1) {
        if (i % 2 == 1 && B[i] != 0) f = false;
        if (i < 2 * N - 3 && B[i] + B[i + 2] != 3) f = false;
    }
    if (f) cout << B.back() << endl;
    else cout << "0\n";
}
0