結果

問題 No.197 手品
ユーザー data9824
提出日時 2015-05-10 01:10:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 975 bytes
コンパイル時間 695 ms
コンパイル使用メモリ 71,876 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 09:36:13
合計ジャッジ時間 1,829 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <map>
using namespace std;

int main() {
	map<string, int> stateGroups;
	map<string, int> stateIds;
	stateGroups["xxx"] = 0;
	stateGroups["xxo"] = 1;
	stateGroups["xox"] = 1;
	stateGroups["xoo"] = 2;
	stateGroups["oxx"] = 1;
	stateGroups["oxo"] = 2;
	stateGroups["oox"] = 2;
	stateGroups["ooo"] = 3;
	stateIds["xxo"] = 0;
	stateIds["xox"] = 1;
	stateIds["xoo"] = 0;
	stateIds["oxx"] = 2;
	stateIds["oxo"] = 1;
	stateIds["oox"] = 2;
	int minTransitions[3][3] = {
		0, 1, 2,
		1, 2, 1,
		2, 1, 0
	};
	string sBefore;
	int n;
	string sAfter;
	cin >> sBefore >> n >> sAfter;
	if (stateGroups[sBefore] != stateGroups[sAfter]) {
		cout << "SUCCESS" << endl;
		return 0;
	}
	int group = stateGroups[sBefore];
	if (group == 0 || group == 3) {
		cout << "FAILURE" << endl;
		return 0;
	}
	if (n < minTransitions[stateIds[sBefore]][stateIds[sAfter]]) {
		cout << "SUCCESS" << endl;
		return 0;
	}
	cout << "FAILURE" << endl;
	return 0;
}
0