結果
| 問題 | 
                            No.197 手品
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-09-28 17:41:08 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 751 bytes | 
| コンパイル時間 | 2,020 ms | 
| コンパイル使用メモリ | 195,508 KB | 
| 最終ジャッジ日時 | 2025-02-07 17:57:45 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 WA * 1 | 
| other | AC * 35 WA * 8 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    string S,T; int N; cin >> S >> N >> T;
    auto c = [](string X) { 
        int res = 0;
        for(char x : X) if(x == 'o') res++;
        return res;
    };
    if(c(S) == c(T)) {
        cout << "FAILURE" << endl;
    } else if(N == 0) {
        cout << (S == T ? "FAILURE" : "SUCCESS") << endl;
    } else if(N == 1) {
        int ex = 0;
        swap(S[0], S[1]); ex |= S == T; swap(S[0], S[1]);
        swap(S[1], S[2]); ex |= S == T; swap(S[1], S[2]);
        cout << (ex ? "FAILURE" : "SUCCESS") << endl;
    } else {
        cout << "FAILURE" << endl;
    }
}