結果

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>

//#include<bits/stdc++.h>



using namespace std;




int main() {
	
	string a;
	int x=0,y=0;
	cin>>a;
	if(a[0]=='o')x++;
	if(a[1]=='o')x++;
	if(a[2]=='o')x++;
	string b;
	long long int n;
	cin>>n;
	cin>>b;
	for(int i=0;i<3;i++){
		if(b[i]=='o')y++;
	}
	
	if(a==b&&x==y&&n==0){
		cout<<"FAILURE"<<endl;
		
		return 0;
	}
	else if(x==y&&n>=2){
		cout<<"FAILURE"<<endl;
		return 0;
	}
	else if(x==y&&n==1){
		string r=a;
		swap(r[0],r[1]);
		if(b==r){
			cout<<"FAILURE"<<endl;
		
		return 0;
		}
		 r=a;
		swap(r[1],r[2]);
		if(b==r){
			cout<<"FAILURE"<<endl;
		
		return 0;
		}
	}
	 cout<<"SUCCESS"<<endl;


	return 0;
}

	
0