結果
| 問題 |
No.1439 Let's Compare!!!!
|
| コンテスト | |
| ユーザー |
NOSS
|
| 提出日時 | 2021-03-26 21:34:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 587 ms / 2,000 ms |
| コード長 | 1,577 bytes |
| コンパイル時間 | 2,705 ms |
| コンパイル使用メモリ | 199,316 KB |
| 最終ジャッジ日時 | 2025-01-19 21:57:09 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
#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;
}
NOSS