結果
| 問題 | 
                            No.197 手品
                             | 
                    
| コンテスト | |
| ユーザー | 
                             femto
                         | 
                    
| 提出日時 | 2015-12-19 23:26:16 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,157 bytes | 
| コンパイル時間 | 493 ms | 
| コンパイル使用メモリ | 62,496 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-27 13:13:47 | 
| 合計ジャッジ時間 | 1,702 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 40 WA * 3 | 
ソースコード
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
	string s1, s2;
	int n;
	cin >> s1 >> n >> s2;
	vector<int> m1, b1, m2, b2;
	for(int i = 0; i < 3; i++) {
		if(s1[i] == 'o') m1.push_back(i);
		else b1.push_back(i);
		if(s2[i] == 'o') m2.push_back(i);
		else b2.push_back(i);
	}
	if(m1.size() != m2.size()) {
		cout << "SUCCESS" << endl;
		return 0;
	}
	if(m1.size() == 3 || b1.size() == 3) {
		cout << "FAILURE" << endl;
		return 0;
	}
	if(m1.size() == 1) {
		if(m1[0] == 1) {
			if(m2[0] == 1 && n == 1) {
				cout << "SUCCESS" << endl;
				return 0;
			}
			else {
				cout << "FAILURE" << endl;
				return 0;
			}
		}
		else {
			if(m1[0] != m2[0] && n < 2) {
				cout << "SUCCESS" << endl;
				return 0;
			}
			else {
				cout << "FAILURE" << endl;
				return 0;
			}
		}
	}
	else {
		if(b1[0] == 1) {
			if(b2[0] == 1 && n == 1) {
				cout << "SUCCESS" << endl;
				return 0;
			}
			else {
				cout << "FAILURE" << endl;
				return 0;
			}
		}
		else {
			if(b1[0] != b2[0] && n < 2) {
				cout << "SUCCESS" << endl;
				return 0;
			}
			else {
				cout << "FAILURE" << endl;
				return 0;
			}
		}
	}
}
            
            
            
        
            
femto