結果

問題 No.197 手品
ユーザー 👑 CleyL
提出日時 2020-03-06 02:19:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 551 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 68,808 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 04:00:58
合計ジャッジ時間 1,772 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  string a,b;int n;cin>>a>>n>>b;
  int z = 0;
  for(int i = 0; 3 > i; i++)z+=a[i]=='o';
  for(int i = 0; 3 > i; i++)z-=b[i]=='o';
  if(z){
    cout << "SUCCESS" << endl;
    return 0;
  }else{
    if(!n){
      if(a!=b){
        cout << "SUCCESS" << endl;
        return 0;
      }
    }else if(n==1){
      reverse(b.begin(),b.end());
      if(a==b && a!="ooo" && a!="xxx"){
        cout << "SUCCESS" << endl;
        return 0;
      }
    }
  }
  cout << "FAILURE" << endl;
}
0