結果

問題 No.2421 entersys?
ユーザー shin3110shin3110
提出日時 2023-08-12 16:05:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 3,246 bytes
コンパイル時間 4,093 ms
コンパイル使用メモリ 241,308 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-30 10:52:33
合計ジャッジ時間 8,711 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

/*

              ∧∧∩ 
             ( ゚∀゚)/ キタ━━━━━━(゚∀゚)━━━━━━!!!!  
            ⊂   ノ  ゆっくり見てってね!!!!!!!!
             (つ ノ
    o          (ノ
     \      ☆
             |      o
          (⌒ ⌒ヽ   /     ☆
    \  (´⌒  ⌒  ⌒ヾ   /
      ('⌒ ; ⌒   ::⌒  )
     (´     )     ::: ) /
  ☆─ (´⌒;:    ::⌒`) :;  )

*/
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

bool printb(bool f) {
	if (f) cout << "Yes\n";
	else cout << "No\n";
	return f;
}

#define elif else if
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(a) a.begin(), a.end()
// xを2進数にした際にi桁目が0か1か
#define bit(x,i)((x>>i)&1)
typedef long long ll;
typedef long double ld;

ld pi = 3.14159265358979;

inline void scan(){}
template<class Head,class... Tail>
inline void scan(Head&head,Tail&... tail){std::cin>>head;scan(tail...);}
 
// print(a, b, c) => cout << a << ' ' << b << ' ' << c << endl;
inline void print(){}
template<class Head,class... Tail>
inline void print(Head&head,Tail&... tail){std::cout<<head<<" ";print(tail...);cout<<endl;}

//vectorのcout,cin
template<typename T>
std::istream &operator>>(std::istream&is,std::vector<T>&v){for(T &in:v){is>>in;}return is;}
template<typename T>
std::ostream &operator<<(std::ostream&os,const std::vector<T>&v){for(auto it=std::begin(v);it!=std::end(v);){os<<*it<<((++it)!=std::end(v)?" ":"");}return os;}

// 2地点の距離(long double)
long double coor_dist(long double xi, long double yi, long double xj, long double yj) {
    return sqrt(abs((xi - xj) * (xi - xj)) + abs((yi - yj) * (yi - yj)));
}

// 回文かどうかの判定
bool iskaibun(string s){ll k = s.size();rep(i,0,k/2){if(s[i]!=s[k-1-i]){return false;}}return true;}







int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n; cin >> n;
    map<string, vector<int>> time;
    fenwick_tree<int> ft(1000000009);
    rep(i, 0, n) {
        string x; ll l, r; cin >> x >> l >> r;
        time[x].push_back(l);
        time[x].push_back(r);
        ft.add(l, 1);
        ft.add(r+1, -1);
    }
    int q; cin >> q;
    while(q--) {
        int z; cin >> z;
        if(z == 1) {
            string x; int t; cin >> x >> t;
            bool ans = false;
            rep(i, 0, time[x].size()/2) {
                if(time[x][i*2] <= t && t <= time[x][i*2+1]) ans = true;
            }
            if(ans) cout << "Yes" << endl;
            else cout << "No" << endl;
        } else if(z == 2) {
            int t; cin >> t;
            cout << ft.sum(0, t) << endl;
        } else {
            string x; cin >> x;
            int l, r; cin >> l >> r;
            time[x].push_back(l);
            time[x].push_back(r);
            ft.add(l, 1);
            ft.add(r+1, -1);
        }
    }
}
0