結果

問題 No.197 手品
コンテスト
ユーザー ninoinui
提出日時 2020-02-16 02:25:32
言語 C++14
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 414µs
コード長 415 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 917 ms
コンパイル使用メモリ 184,456 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-19 11:22:33
合計ジャッジ時間 3,175 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

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