結果

問題 No.197 手品
ユーザー kkslucy1
提出日時 2018-03-13 03:53:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 646 bytes
コンパイル時間 1,861 ms
コンパイル使用メモリ 167,000 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 13:54:32
合計ジャッジ時間 3,172 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 41 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
	string sb;
	cin >> sb;
	ll n;
	cin >> n;
	string sa;
	cin >> sa;

	set<string>sets;
	sets.insert(sb);
	if (n >= 1) {
		string sd[] = { "xoo","oxx","xxo","oox" };
		string sd2[] = { "oxo","xox","xox","oxo" };
		for (int i = 0;i < 4;i++) {
			if (sb == sd[i]) {
				sets.insert(sd2[i]);
				if (n >= 2) {
					for (int j = 0;j < 4;j++) {
						if (sd2[i] == sd2[j]) {
							sets.insert(sd[j]);
						}
					}
				}
			}
			if (sb == sd2[i]) {
				sets.insert(sd[i]);
			}
		}
	}
	cout << ((sets.find(sa) == sets.end()) ?  "SUCCESS":"FAILURE") << endl;
	return 0;
}
0