結果

問題 No.197 手品
ユーザー kotatsugame
提出日時 2017-08-10 13:17:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 65,664 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 13:49:41
合計ジャッジ時間 1,657 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
string s,t;int n,a,b,c,d,f;
main()
{
	cin>>s>>n>>t;
	for(int i=0;i<3;i++)s[i]=='o'?a++:b++;
	for(int i=0;i<3;i++)t[i]=='o'?c++:d++;
	if(a-c||b-d)f=1;
	else if(a-3&&b-3)
	{
		if(s=="oxx")f=t!=s&&(t!="xox"||!n)&&(t!="xxo"||n<2);
		else if(s=="xox")f=(t!="oxx"&&t!="xxo"||!n)&&(t!=s||n<2);
		else if(s=="xxo")f=t!=s&&(t!="xox"||!n)&&(t!="oxx"||n<2);
		else if(s=="xoo")f=t!=s&&(t!="oxo"||!n)&&(t!="oox"||n<2);
		else if(s=="oxo")f=(t!="xoo"&&t!="oox"||!n)&&(t!=s||n<2);
		else if(s=="oox")f=t!=s&&(t!="oxo"||!n)&&(t!="xoo"||n<2);
	}
	cout<<(f?"SUCCESS":"FAILURE")<<endl;
}
0