結果

問題 No.197 手品
ユーザー めうめう🎒
提出日時 2016-03-27 23:01:15
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,099 bytes
コンパイル時間 691 ms
コンパイル使用メモリ 82,940 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 03:47:43
合計ジャッジ時間 1,957 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <iomanip>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

int main() {
	string str_bef,str_aft;
	int n,how_bef = 0,how_aft = 0;
	cin >> str_bef >> n >> str_aft;
	for(int i = 0;i < 3;i++){
		if(str_bef[i] == 'o') how_bef++;
		if(str_aft[i] == 'o') how_aft++;
	}

	if((n == 0 && str_bef != str_aft) || (how_bef != how_aft)){
		cout << "SUCCESS" << endl;
	}else if(n == 1 && str_bef[0] != str_bef[1] && str_bef[0] != str_bef[2] && str_aft[2] != str_aft[1] && str_aft[2] != str_aft[0]){
		cout << "SUCCESS" << endl;
	}else if(n == 1 && str_aft[0] != str_aft[1] && str_aft[0] != str_aft[2] && str_bef[2] != str_bef[1] && str_bef[2] != str_bef[0]){
		cout << "SUCCESS" << endl;
	}else if(n == 1 && str_bef[1] != str_bef[0] && str_bef[1] != str_bef[2] && str_bef == str_aft){
		cout << "SUCCESS" << endl;
	}else{
		cout << "FAILURE" << endl;
	}
	return 0;
}
0