結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー 沙耶花沙耶花
提出日時 2024-02-23 21:35:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 354 ms / 2,500 ms
コード長 684 bytes
コンパイル時間 4,307 ms
コンパイル使用メモリ 268,028 KB
実行使用メモリ 9,216 KB
最終ジャッジ日時 2024-02-23 21:36:06
合計ジャッジ時間 14,943 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 129 ms
6,548 KB
testcase_03 AC 25 ms
6,548 KB
testcase_04 AC 147 ms
6,548 KB
testcase_05 AC 124 ms
6,548 KB
testcase_06 AC 64 ms
6,548 KB
testcase_07 AC 122 ms
6,548 KB
testcase_08 AC 59 ms
6,548 KB
testcase_09 AC 309 ms
9,216 KB
testcase_10 AC 317 ms
9,216 KB
testcase_11 AC 312 ms
9,216 KB
testcase_12 AC 312 ms
9,216 KB
testcase_13 AC 304 ms
9,216 KB
testcase_14 AC 319 ms
9,216 KB
testcase_15 AC 323 ms
9,216 KB
testcase_16 AC 327 ms
9,216 KB
testcase_17 AC 323 ms
9,216 KB
testcase_18 AC 329 ms
9,216 KB
testcase_19 AC 329 ms
9,216 KB
testcase_20 AC 354 ms
9,216 KB
testcase_21 AC 334 ms
9,216 KB
testcase_22 AC 330 ms
9,216 KB
testcase_23 AC 310 ms
9,216 KB
testcase_24 AC 310 ms
9,216 KB
testcase_25 AC 327 ms
9,216 KB
testcase_26 AC 307 ms
9,216 KB
testcase_27 AC 311 ms
9,216 KB
testcase_28 AC 311 ms
9,216 KB
testcase_29 AC 311 ms
9,216 KB
testcase_30 AC 312 ms
9,216 KB
testcase_31 AC 316 ms
9,216 KB
testcase_32 AC 237 ms
8,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 1000000000000000001


int main(){
	
	int N,A;
	cin>>N>>A;
	set<pair<int,int>> S;
	rep(i,N){
		int x;
		cin>>x;
		S.emplace(x,i);
	}
	int T;
	cin>>T;
	vector<int> l(T),r(T);
	rep(i,T)cin>>l[i]>>r[i];
	vector<int> ans(N,-1);
	for(int i=T-1;i>=0;i--){
		auto it = S.lower_bound(make_pair(l[i],-1));
		while(it!=S.end()){
			if(it->first > r[i])break;
			ans[it->second] = i+1;
			it = S.erase(it);
		}
	}
	rep(i,N){
		cout<<ans[i]<<endl;
	}
	
	
	return 0;
}
0