結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
btk
|
| 提出日時 | 2015-04-30 22:08:05 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 360 bytes |
| コンパイル時間 | 567 ms |
| コンパイル使用メモリ | 58,952 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-20 03:37:18 |
| 合計ジャッジ時間 | 1,561 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 43 |
ソースコード
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(void){
string s,t;
int N;
cin>>s>>N>>t;
N=1<<min(N,4);
bool flag=false;
for(int i=0;i<N;i++){
string u=s;
for(int j=0;(1<<j)<N;j++)
if((1<<j)&i)swap(u[0],u[1]);
else swap(u[2],u[1]);
if(u==t)flag=true;
}
if(flag)cout<<"FAILURE"<<endl;
else cout<<"SUCCESS"<<endl;
return 0;
}
btk