結果
| 問題 | No.1439 Let's Compare!!!! | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-03-26 21:27:09 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 466 ms / 2,000 ms | 
| コード長 | 527 bytes | 
| コンパイル時間 | 822 ms | 
| コンパイル使用メモリ | 74,532 KB | 
| 実行使用メモリ | 12,032 KB | 
| 最終ジャッジ日時 | 2024-11-29 08:35:48 | 
| 合計ジャッジ時間 | 5,592 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 17 | 
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
#include<set>
using namespace std;
int N,Q;
string S,T;
main()
{
	cin>>N>>S>>T>>Q;
	set<int>L,R;
	L.insert(N);
	R.insert(N);
	for(int i=0;i<N;i++)
	{
		if(S[i]<T[i])R.insert(i);
		else if(S[i]>T[i])L.insert(i);
	}
	for(;Q--;)
	{
		char c;
		int x,y;cin>>c>>x>>y;
		x--;
		if(S[x]<T[x])R.erase(x);
		else if(S[x]>T[x])L.erase(x);
		if(c=='S')S[x]=y+'0';
		else T[x]=y+'0';
		if(S[x]<T[x])R.insert(x);
		else if(S[x]>T[x])L.insert(x);
		int l=*L.begin(),r=*R.begin();
		cout<<(l<r?">\n":l>r?"<\n":"=\n");
	}
}
            
            
            
        