結果

問題 No.197 手品
ユーザー SSRSSSRS
提出日時 2020-11-18 15:44:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 786 bytes
コンパイル時間 681 ms
コンパイル使用メモリ 73,244 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-30 15:02:32
合計ジャッジ時間 2,780 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 WA -
testcase_38 AC 2 ms
4,376 KB
testcase_39 AC 2 ms
4,380 KB
testcase_40 AC 1 ms
4,376 KB
testcase_41 AC 1 ms
4,380 KB
testcase_42 AC 2 ms
4,376 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 WA -
testcase_45 AC 1 ms
4,380 KB
testcase_46 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<vector<int>> E = {{0}, {1, 2}, {1, 4}, {3, 5}, {2, 4}, {3, 6}, {5, 6}, {7}}; 
int main(){
	string S;
	cin >> S;
	int N;
	cin >> N;
	string T;
	cin >> T;
	if (N >= 2){
		N = (N - 1) % 2 + 1;
	}
	int s = 0;
	for (int i = 0; i < 3; i++){
		if (S[i] == 'o'){
			s += 1 << i;
		}
	}
	int t = 0;
	for (int i = 0; i < 3; i++){
		if (T[i] == 'o'){
			t += 1 << i;
		}
	}
	bool ok = false;
	if (N == 0){
		if (s == t){
			ok = true;
		}
	}
	if (N == 1){
		for (int v : E[s]){
			if (v == t){
				ok = true;
			}
		}
	}
	if (N == 2){
		for (int v : E[s]){
			for (int w : E[v]){
				if (w == t){
					ok = true;
				}
			}
		}
	}
	if (ok){
		cout << "FAILURE" << endl;
	} else {
		cout << "SUCCESS" << endl;
	}
}
0