結果

問題 No.1717 Levi-Civita Triangle
ユーザー square1001square1001
提出日時 2021-10-22 21:37:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 944 bytes
コンパイル時間 839 ms
コンパイル使用メモリ 75,816 KB
実行使用メモリ 6,732 KB
最終ジャッジ日時 2023-10-24 12:35:04
合計ジャッジ時間 3,319 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 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 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 8 ms
4,348 KB
testcase_07 AC 42 ms
5,252 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 7 ms
4,348 KB
testcase_12 AC 25 ms
4,604 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1 ms
4,348 KB
testcase_19 WA -
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 6 ms
4,348 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 15 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 70 ms
6,668 KB
testcase_34 AC 68 ms
6,668 KB
testcase_35 AC 66 ms
6,668 KB
testcase_36 AC 65 ms
6,668 KB
testcase_37 AC 63 ms
6,668 KB
testcase_38 AC 63 ms
6,668 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <iostream>
#include <algorithm>
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];
	}
	vector<int> B(2 * N - 1);
	for (int i = 0; i <= 2 * N - 2; ++i) {
		vector<int> seq = { A[i], A[i + 1], A[i + 2] };
		if (seq == vector<int>({ 0, 1, 2 }) || seq == vector<int>({ 1, 2, 0 }) || seq == vector<int>({ 2, 0, 1 })) {
			B[i] = 1;
		}
		else if (seq == vector<int>({ 0, 2, 1 }) || seq == vector<int>({ 1, 0, 2 }) || seq == vector<int>({ 2, 1, 0 })) {
			B[i] = 2;
		}
		else {
			B[i] = 0;
		}
	}
	vector<int> s0, s1;
	for (int i = 0; i <= 2 * N - 2; ++i) {
		if (i % 2 == 1) {
			s0.push_back(0);
			s1.push_back(0);
		}
		else {
			s0.push_back(i % 4 == 0 ? 1 : 2);
			s1.push_back(i % 4 == 0 ? 2 : 1);
		}
	}
	if (B == s0) {
		cout << 1 << endl;
	}
	else if (B == s1) {
		cout << 2 << endl;
	}
	else {
		cout << 0 << endl;
	}
	return 0;
}
0