結果
| 問題 |
No.1439 Let's Compare!!!!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-17 12:42:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 429 ms / 2,000 ms |
| コード長 | 1,521 bytes |
| コンパイル時間 | 3,568 ms |
| コンパイル使用メモリ | 180,404 KB |
| 最終ジャッジ日時 | 2025-01-20 21:10:37 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
#include <atcoder/all>
#include <bitset>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using namespace atcoder;
//* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *//
void input() {
}
void solve() {
int N; cin >> N;
string S, T; cin >> S >> T;
set<int> idx;
for(int i = 0; i < N; i++) {
if(S[i] != T[i]) idx.insert(i);
}
int Q; cin >> Q;
while(Q--) {
char c; cin >> c;
int x, y; cin >> x >> y; x--;
if(c == 'S') S[x] = y + '0';
else T[x] = y + '0';
if(S[x] == T[x]) {
if(idx.find(x) != idx.end()) {
idx.erase(x);
}
} else {
idx.insert(x);
}
if(!idx.empty()) {
auto itr = idx.begin();
if(S[*itr] < T[*itr]) cout << '<' << endl;
else cout << '>' << endl;
} else {
cout << '=' << endl;
}
}
}
//* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *//
int main() {
std::ifstream in("input.txt");
std::cin.rdbuf(in.rdbuf());
std::cin.tie(0);
ios::sync_with_stdio(false);
input();
solve();
return 0;
}