結果

問題 No.197 手品
ユーザー dnish
提出日時 2017-05-03 11:34:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 1,561 ms
コンパイル使用メモリ 168,168 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-06-27 13:45:39
合計ジャッジ時間 2,858 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define p(s) cout<<(s)<<endl
using namespace std;

int main(){
	string sb,sa,ans="FAILURE";
	int N;
	cin>>sb>>N>>sa;
	string rsb=sb;
	reverse(rsb.begin(),rsb.end());
	int cntb=count(sb.begin(),sb.end(),'o');
	int cnta=count(sa.begin(),sa.end(),'o');

	if(cnta!=cntb) 			ans="SUCCESS";
	if(cnta==1 || cnta==2){
		if(N==1&&sa==rsb)	ans="SUCCESS";
	}

	p(ans);
	return 0;
}
0