結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-28 17:41:52 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 1,000 ms |
| コード長 | 751 bytes |
| コンパイル時間 | 1,904 ms |
| コンパイル使用メモリ | 195,088 KB |
| 最終ジャッジ日時 | 2025-02-07 17:57:53 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 43 |
ソースコード
#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 << "SUCCESS" << 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;
}
}