結果
| 問題 | 
                            No.197 手品
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ferin
                         | 
                    
| 提出日時 | 2017-03-01 17:04:25 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 1,200 bytes | 
| コンパイル時間 | 1,251 ms | 
| コンパイル使用メモリ | 161,316 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-20 03:50:57 | 
| 合計ジャッジ時間 | 2,540 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 43 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MOD 1000000007
#define INF (1LL << 25) // 33554432
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll
signed main(void) {
  int n, a = 0, b = 0;
  string s, t;
  cin >> s >> n >> t;
  REP(i, s.size()) {
    if (s[i] == 'o')
      a++;
    if (t[i] == 'o')
      b++;
  }
  if (a != b) {
    cout << "SUCCESS" << endl;
    return 0;
  }
  if (n == 1) {
    if (a == 1) {
      if ((s == "oxx" && t == "xxo") || (s == "xxo" && t == "oxx") || (s == "xox" && t == "xox")) {
        cout << "SUCCESS" << endl;
        return 0;
      }
    } else if (a == 2) {
      if ((s == "oox" && t == "xoo") || (s == "xoo" && t == "oox") || (s == "oxo" && t == "oxo")) {
        cout << "SUCCESS" << endl;
        return 0;
      }
    }
  } else if(n == 0) {
    if(s != t) {
      cout << "SUCCESS" << endl;
      return 0;
    }
  }
  cout << "FAILURE" << endl;
  return 0;
}
            
            
            
        
            
ferin