結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-10 13:13:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 609 bytes |
| コンパイル時間 | 695 ms |
| コンパイル使用メモリ | 65,792 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 13:49:37 |
| 合計ジャッジ時間 | 1,903 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 37 WA * 6 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#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!="xox"||!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;
}