結果

問題 No.2421 entersys?
ユーザー m_99m_99
提出日時 2023-08-12 14:13:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,727 bytes
コンパイル時間 4,253 ms
コンパイル使用メモリ 238,452 KB
実行使用メモリ 16,248 KB
最終ジャッジ日時 2024-04-30 05:22:08
合計ジャッジ時間 8,442 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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



int main(){
	
	int n,q;
	cin>>n;
	
	vector<string> x(n);
	vector<int> l(n),r(n);
	vector<int> t;
	rep(i,n){
		cin>>x[i]>>l[i]>>r[i];
		r[i]++;
		t.push_back(l[i]);
		t.push_back(r[i]);
	}
	cin>>q;
	vector<int> type(q);
	vector<string> qx(q);
	vector<int> a(q),b(q);
	rep(i,q){
		cin>>type[i];
		if(type[i]==1){
			cin>>qx[i];
			cin>>a[i];
			t.push_back(a[i]);
		}
		if(type[i]==2){
			cin>>a[i];
			t.push_back(a[i]);
		}
		if(type[i]==3){
			cin>>qx[i];
			cin>>a[i]>>b[i];
			b[i]++;
			t.push_back(a[i]);
			t.push_back(b[i]);
		}
	}
	sort(t.begin(),t.end());
	t.erase(unique(t.begin(),t.end()));
	
	fenwick_tree<long long> F(t.size()+5);
	map<string,map<int,int>> mp;
	/*
	rep(i,n){
		mp[x[i]][l[i]] = r[i];
		int d = distance(t.begin(),lower_bound(t.begin(),t.end(),l[i]));
		F.add(d,1);
		d = distance(t.begin(),lower_bound(t.begin(),t.end(),r[i]));
		F.add(d,-1);
	}
	rep(i,q){
		if(type[i]==1){
			auto it = mp[qx[i]].upper_bound(a[i]);
			if(it==mp[qx[i]].begin())cout<<"No"<<endl;
			else{
				it--;
				if((it->first) <= a[i] && a[i] < (it->second))cout<<"Yes"<<endl;
				else cout<<"No"<<endl;
			}
			
		}
		if(type[i]==2){
			int d = distance(t.begin(),lower_bound(t.begin(),t.end(),a[i]));
			cout<<F.sum(0,d+1)<<endl;
		}
		if(type[i]==3){
			int d = distance(t.begin(),lower_bound(t.begin(),t.end(),a[i]));
			F.add(d,1);
			d = distance(t.begin(),lower_bound(t.begin(),t.end(),b[i]));
			F.add(d,-1);
			mp[qx[i]][a[i]] = b[i];
		}
		
	}*/
	
	return 0;
}
0