結果
| 問題 |
No.1439 Let's Compare!!!!
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2021-03-26 22:09:56 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,267 ms / 2,000 ms |
| コード長 | 609 bytes |
| コンパイル時間 | 5,886 ms |
| コンパイル使用メモリ | 254,560 KB |
| 最終ジャッジ日時 | 2025-01-19 22:47:21 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
#include <atcoder/all>
using namespace atcoder;
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
int N,Q;
string S,T;
set<int> G;
int main(){
cin>>N>>S>>T>>Q;
rep(i,N) if(S[i]!=T[i]) G.insert(i);
rep(i,Q){
char c; int x,y; cin>>c>>x>>y; x--;
if(S[x]!=T[x]) G.erase(x);
if(c=='S') S[x]=y+'0';
if(c=='T') T[x]=y+'0';
if(S[x]!=T[x]) G.insert(x);
if(G.size()==0) printf("=\n");
else{
int p=*G.begin();
if(S[p]<T[p]) printf("<\n"); else printf(">\n");
}
}
return 0;
}
Nachia