結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー kotatsugamekotatsugame
提出日時 2024-02-23 21:28:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 170 ms / 2,500 ms
コード長 550 bytes
コンパイル時間 622 ms
コンパイル使用メモリ 73,788 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2024-02-23 21:28:40
合計ジャッジ時間 6,250 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 37 ms
6,548 KB
testcase_03 AC 20 ms
6,548 KB
testcase_04 AC 44 ms
6,548 KB
testcase_05 AC 37 ms
6,548 KB
testcase_06 AC 19 ms
6,548 KB
testcase_07 AC 36 ms
6,548 KB
testcase_08 AC 17 ms
6,548 KB
testcase_09 AC 93 ms
9,344 KB
testcase_10 AC 95 ms
9,344 KB
testcase_11 AC 94 ms
9,344 KB
testcase_12 AC 91 ms
9,344 KB
testcase_13 AC 100 ms
9,344 KB
testcase_14 AC 94 ms
9,344 KB
testcase_15 AC 96 ms
9,344 KB
testcase_16 AC 130 ms
9,344 KB
testcase_17 AC 129 ms
9,344 KB
testcase_18 AC 125 ms
9,344 KB
testcase_19 AC 170 ms
9,344 KB
testcase_20 AC 136 ms
9,344 KB
testcase_21 AC 136 ms
9,344 KB
testcase_22 AC 128 ms
9,344 KB
testcase_23 AC 102 ms
9,344 KB
testcase_24 AC 104 ms
9,344 KB
testcase_25 AC 102 ms
9,344 KB
testcase_26 AC 123 ms
9,344 KB
testcase_27 AC 104 ms
9,344 KB
testcase_28 AC 107 ms
9,344 KB
testcase_29 AC 103 ms
9,344 KB
testcase_30 AC 100 ms
9,344 KB
testcase_31 AC 98 ms
9,344 KB
testcase_32 AC 82 ms
8,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<set>
#include<cassert>
using namespace std;
int ans[1<<17];
int N,A,T,L[1<<17],R[1<<17];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>N>>A;
	set<pair<int,int> >S;
	for(int i=0;i<N;i++)
	{
		ans[i]=-1;
		int x;cin>>x;
		S.insert(make_pair(x,i));
	}
	cin>>T;
	for(int t=1;t<=T;t++)cin>>L[t]>>R[t];
	for(int t=T;t>=1;t--)
	{
		auto it=S.lower_bound(make_pair(L[t],0));
		while(it!=S.end()&&it->first<=R[t])
		{
			ans[it->second]=t;
			it=S.erase(it);
		}
	}
	for(int i=0;i<N;i++)cout<<ans[i]<<"\n";
}
0