Submission #74539689


Source Code Expand

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define mrep(i,n) for (int i = 1; i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define rev(a) (a).rbegin(), (a).rend()
#define pb push_back
#define pob pop_back

int main() {
  int q;
  cin >> q;
  priority_queue<ll, vector<ll>, greater<ll>> pq;

  rep(qi,q) {
    ll t, h;
    cin >> t >> h;
    if(t == 1) {
      pq.push(h);
    } else {
      while(!pq.empty() && pq.top() <= h) pq.pop();
    }
    cout << pq.size() << "\n";
  }
}

Submission Info

Submission Time
Task C - Understory
User WebP
Language C++23 (GCC 15.2.0)
Score 300
Code Size 660 Byte
Status AC
Exec Time 246 ms
Memory 7664 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 13
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3572 KiB
00_sample_01.txt AC 1 ms 3572 KiB
01_random_00.txt AC 231 ms 3672 KiB
01_random_01.txt AC 232 ms 3572 KiB
01_random_02.txt AC 236 ms 3568 KiB
01_random_03.txt AC 238 ms 3572 KiB
01_random_04.txt AC 239 ms 7664 KiB
01_random_05.txt AC 239 ms 3928 KiB
01_random_06.txt AC 227 ms 4588 KiB
01_random_07.txt AC 246 ms 5696 KiB
01_random_08.txt AC 221 ms 5616 KiB
01_random_09.txt AC 243 ms 5560 KiB
01_random_10.txt AC 236 ms 3728 KiB