結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  string S, T;
  int N;
  cin >> S >> N >> T;
  if (count(S.begin(), S.end(), 'o') != count(T.begin(), T.end(), 'o')) cout << "SUCCESS";
  else if (N == 0) cout << ((S != T) ? "SUCCESS" : "FAILURE");
  else if (N > 1) cout << "FAILURE";
  else {
    string s = S;
    swap(S.at(0), S.at(1)), swap(s.at(1), s.at(2));
    cout << ((S == T || s == T) ? "FAILURE" : "SUCCESS");
  }
  cout << "\n";
}
0