結果

問題 No.197 手品
ユーザー kohei2019kohei2019
提出日時 2021-09-08 21:32:06
言語 C++17(clang)
(14.0.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 3,152 bytes
コンパイル時間 2,960 ms
コンパイル使用メモリ 134,720 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-27 06:48:12
合計ジャッジ時間 5,288 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 1 ms
4,376 KB
testcase_39 AC 2 ms
4,376 KB
testcase_40 AC 2 ms
4,380 KB
testcase_41 AC 2 ms
4,380 KB
testcase_42 AC 2 ms
4,376 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 2 ms
4,380 KB
testcase_45 AC 2 ms
4,376 KB
testcase_46 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll,ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vs = vector<string>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define INF 100000000
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define FORA(i,I) for(const auto& i:I)
//x:コンテナ
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
//定数
#define INF32 2147483647 //2.147483647×10^{9}:32bit整数のinf
#define INF64 9223372036854775807 //9.223372036854775807×10^{18}:64bit整数のinf
#define MOD 1000000007 //問題による
#define F first
#define S second
//出力(空白区切りで昇順に)
#define coutALL(x) for(auto i=x.begin();i!=--x.end();i++)cout<<*i<<" ";cout<<*--x.end()<<endl
#define coutALLn(x) for(auto i=x.begin();i!=--x.end();i++)cout<<*i<<endl;cout<<*--x.end()<<endl
ll myceil(ll a,ll b){return (a+(b-1))/b;}
ll myfloor(ll a,ll b){return a/b;}

int vector_finder(std::vector<int> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

vector<ll> vector_find_ll(vector<ll> vec,ll num){
    int N = vec.size();
    vector<ll> match_num;
    rep(i,N){
        if (vec[i] == num){
            match_num.push_back(i);
        }
    }
    return match_num;
}

ll vector_max(vector<ll> vec){
    ll ret = -INF64;
    rep(i,vec.size()){
        ret = max(ret,vec[i]);
    }
    return ret;
}

ll vector_min(vector<ll> vec){
    ll ret = INF64;
    rep(i,vec.size()){
        ret = min(ret,vec[i]);
    }
    return ret;
}




int main(){
    string st,en;
    ll N;
    cin >> st;
    cin >> N;
    cin >> en;
    int sto=0,stx=0,eno=0,enx=0;
    rep(i,3){
        if (st[i]=='o'){
            sto += 1;
        }
        else{
            stx += 1;
        }
        if (en[i]=='o'){
            eno += 1;
        }
        else{
            enx += 1;
        }
    }
    if (sto != eno){
        cout << "SUCCESS" << endl;
        return 0;
    }
    if (sto == 0 || sto==3){
        cout << "FAILURE" << endl;
        return 0;        
    }
    if (N >= 2){
        cout << "FAILURE" << endl;
        return 0;          
    }
    if (N == 0){
        if (st == en){
            cout << "FAILURE" << endl;
            return 0;     
        }
        else{
            cout << "SUCCESS" << endl;
            return 0;                 
        }
    }
    if (N==1){
        if (st == en){
            if (st[0] == st[2]){
                cout << "SUCCESS" << endl;
                return 0;  
            }
            cout << "FAILURE" << endl;
            return 0;     
        }
        if (st[0] == en[2] && st[2] == en[0]){
            cout << "SUCCESS" << endl;
            return 0;     
        }
        cout << "FAILURE" << endl;
        return 0;             
    }
}
0