結果

問題 No.1717 Levi-Civita Triangle
ユーザー ぷらぷら
提出日時 2021-10-22 22:46:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,192 bytes
コンパイル時間 2,157 ms
コンパイル使用メモリ 209,868 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 14:08:43
合計ジャッジ時間 3,951 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 4 ms
4,348 KB
testcase_07 AC 20 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 4 ms
4,348 KB
testcase_12 AC 12 ms
4,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 26 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 WA -
testcase_20 AC 2 ms
4,348 KB
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 AC 2 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 3 ms
4,348 KB
testcase_32 WA -
testcase_33 AC 34 ms
4,348 KB
testcase_34 AC 33 ms
4,348 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 33 ms
4,348 KB
testcase_40 AC 33 ms
4,348 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int>A(2*N+1);
    for(int i = 0; i <= 2*N; i++) {
        cin >> A[i];
    }
    if(2*N+1 == 3) {
        vector<vector<int>>base = {{0,1,2},{1,2,0},{2,0,1}};
        if(A == base[0] || A == base[1] || A == base[2]) {
            cout << 1 << endl;
        }
        else {
            base = {{2,1,0},{1,0,2},{0,2,1}};
            if(A == base[0] || A == base[1] || A == base[2]) {
                cout << 2 << endl;
            }
            else {
                cout << 0 << endl;
            }
        }
        return 0;
    }
    int f = A[0] != 0;
    for(int i = 1; i <= 2*N; i += 2) {
        if(A[i] != 0) {
            f = 0;
        }
    }
    if(f == 0) {
        cout << 0 << endl;
    }
    else {
        for(int i = 2; i <= 2*N; i += 2) {
            if(A[i] == 0 || A[i-2] == A[i]) {
                f = 0;
            }
        }
        if(f == 0) {
            cout << 0 << endl;
        }
        else {
            if(N%2 == A[0]%2) {
                cout << 2 << endl;
            }
            else {
                cout << 1 << endl;
            }
        }
    }
}
0