제출 #1347745

#제출 시각아이디문제언어결과실행 시간메모리
1347745MuhammadSaram돌 무게 재기 (IZhO11_stones)C++20
0 / 100
0 ms344 KiB
#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

void solve()
{
	int n;
	cin>>n;
	set<int> se[2];
	for (int i=0;i<n;i++)
	{
		int x,s;
		cin>>x>>s;s--;
		se[s].insert(x);
		char ans='?';
		string o="<>";
		for (int j=0;j<2;j++)
		{
			if (se[j].size()>se[1-j].size()) continue;
			bool pos=1;
			int pr=n+1;
			auto it=se[j].rbegin();
			while (it!=se[j].rend())
			{
				auto it1=se[1-j].lower_bound(*it);
				if (it1==se[1-j].end() or (*it1)>=pr)
				{
					pos=0;
					break;
				}
				pr=*it1,it++;
			}
			if (pos)
				ans=o[j];
		}
		cout<<ans<<endl;
	}
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL), cout.tie(NULL);

	int t=1;
	// cin>>t;
	while (t--)
		solve();

	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...