結果
| 問題 | 
                            No.197 手品
                             | 
                    
| コンテスト | |
| ユーザー | 
                             not_522
                         | 
                    
| 提出日時 | 2015-08-03 23:55:11 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 421 bytes | 
| コンパイル時間 | 2,114 ms | 
| コンパイル使用メモリ | 167,772 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-20 03:42:08 | 
| 合計ジャッジ時間 | 2,864 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 43 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  int n;
  cin >> b >> n >> a;
  set<string> s;
  s.insert(a);
  for (int i = 0; i < min(n, 4); ++i) {
    set<string> t;
    for (string ss : s) {
      swap(ss[0], ss[1]);
      t.insert(ss);
      swap(ss[0], ss[1]);
      swap(ss[1], ss[2]);
      t.insert(ss);
    }
    s = t;
  }
  cout << (s.count(b) ? "FAILURE" : "SUCCESS") << endl;
}
            
            
            
        
            
not_522