結果

問題 No.1439 Let's Compare!!!!
ユーザー NOSSNOSS
提出日時 2021-03-26 21:34:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 1,577 bytes
コンパイル時間 1,991 ms
コンパイル使用メモリ 205,724 KB
実行使用メモリ 11,932 KB
最終ジャッジ日時 2023-08-19 15:11:36
合計ジャッジ時間 6,095 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 7 ms
4,380 KB
testcase_08 AC 11 ms
4,380 KB
testcase_09 AC 5 ms
4,376 KB
testcase_10 AC 369 ms
11,684 KB
testcase_11 AC 311 ms
6,804 KB
testcase_12 AC 301 ms
6,848 KB
testcase_13 AC 366 ms
11,928 KB
testcase_14 AC 359 ms
11,932 KB
testcase_15 AC 285 ms
4,384 KB
testcase_16 AC 263 ms
4,376 KB
testcase_17 AC 259 ms
4,380 KB
testcase_18 AC 258 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using P = pair<int, int>;
using P3 = pair<int,P>;
using PP = pair<P, P>;
constexpr int INF32 = 1 << 30;
constexpr ll INF64 = 1LL << 62;
// constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
constexpr int di[] = {0, 1, 0, -1};
constexpr int dj[] = {1, 0, -1, 0};
constexpr int di8[] = {0, 1, 1, 1, 0, -1, -1, -1};
constexpr int dj8[] = {1, 1, 0, -1, -1, -1, 0, 1};
constexpr double EPS = 1e-10;
const double PI = acos(-1);

#define ALL(v) (v).begin(),(v).end()
#define REP(i,n) for(int i=0,i_len=n; i<i_len; ++i)

template<typename T1,typename T2> bool chmax(T1 &a, T2 b) { if (a<b) { a=b; return 1; } return 0; }
template<typename T1,typename T2> bool chmin(T1 &a, T2 b) { if (b<a) { a=b; return 1; } return 0; }

int solve(){
    int n, q;
    string s, t;
    cin >> n >> s >> t >> q;
    set<int> pos;
    REP(i,n){
        if(s[i]!=t[i]) pos.insert(i);
    }
    REP(i,q){
        char c;
        int x, y;
        cin >> c >> x >> y;
        x--;
        if(c=='S') s[x] = '0'+y;
        else t[x] = '0'+y;
        if(s[x]!=t[x]) pos.insert(x);
        else pos.erase(x);
        if(pos.empty()){
            cout << "=" << endl;
        }else{
            int k = *pos.begin();
            cout << (s[k]>t[k] ? ">":"<") << endl;
        }
    }
    return 0;
}

int main(){
    cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    // int t; cin >> t; for(int i=0;i<t;i++) solve();
    // while(!solve());
    solve();
    return 0;
}
0