結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-02-18 15:30:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 760 bytes |
| コンパイル時間 | 470 ms |
| コンパイル使用メモリ | 62,220 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 13:17:52 |
| 合計ジャッジ時間 | 1,613 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 41 WA * 2 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define RREP(i,s,e) for (int i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (int i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
int main() {
string s1,s2;
long long n;
int cnt1, cnt2;
cin >> s1 >> n >> s2;
cnt1 = cnt2 = 0;
rep (i,3) {
cnt1 += s1[i] == 'o';
cnt2 += s2[i] == 'o';
}
if (cnt1 != cnt2 || n == 0 && s1 != s2)
cout << "SUCCESS" << endl;
else if (n >= 2 || s1 == s2)
cout << "FAILURE" << endl;
else if (string{}+s1[1]+s1[0]+s1[2] == s2 || string{}+s1[0]+s1[2]+s1[1] == s2)
cout << "FAILURE" << endl;
else
cout << "SUCCESS" << endl;
return 0;
}
h_noson