Submission #76084609


Source Code Expand

//競プロ C++テンプレ
#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main() {
  map<int,int> mp;
  int kesi = 0;
    int N,K;
    cin >> N >> K;
  
    for(int i = 0; i < K;i++){
      int aa,bb;
      cin >> aa >> bb;
      if(aa == 1){
        if(mp.find(bb) != mp.end()){
          int kk = mp[bb];
          mp[bb] = kk + 1;
        }else{
          mp[bb] = 1;
        }
        if(int(mp.size()) == N){
          bool isok = true;
          for (auto p : mp){
             if(p.second < kesi){
               isok = false;
             }
          }
          if(isok) kesi++;
        }
        
      
      }else{
        ll ans = 0;
        for(auto p:mp){
          if(p.second >= bb + kesi){
            ans++;
          }
        }
        cout << ans << endl;
      }

    }
}

Submission Info

Submission Time
Task C - Drop Blocks
User gumi11ta
Language C++23 (GCC 15.2.0)
Score 0
Code Size 867 Byte
Status WA
Exec Time > 2000 ms
Memory 17620 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
AC × 26
WA × 10
TLE × 14
Set Name Test Cases
Sample example_00.txt
All example_00.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, hand_20.txt, hand_21.txt, hand_22.txt, hand_23.txt, hand_24.txt, hand_25.txt, hand_26.txt, hand_27.txt, hand_28.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3440 KiB
hand_00.txt AC 233 ms 17504 KiB
hand_01.txt AC 234 ms 17620 KiB
hand_02.txt TLE > 2000 ms 3588 KiB
hand_03.txt TLE > 2000 ms 3436 KiB
hand_04.txt TLE > 2000 ms 4312 KiB
hand_05.txt TLE > 2000 ms 3660 KiB
hand_06.txt TLE > 2000 ms 3800 KiB
hand_07.txt AC 49 ms 3500 KiB
hand_08.txt AC 154 ms 3428 KiB
hand_09.txt AC 104 ms 3572 KiB
hand_10.txt WA 107 ms 3488 KiB
hand_11.txt AC 65 ms 3480 KiB
hand_12.txt AC 65 ms 3424 KiB
hand_13.txt AC 169 ms 3424 KiB
hand_14.txt AC 124 ms 3572 KiB
hand_15.txt AC 123 ms 3612 KiB
hand_16.txt AC 1 ms 3572 KiB
hand_17.txt AC 180 ms 3500 KiB
hand_18.txt AC 49 ms 3512 KiB
hand_19.txt AC 49 ms 3500 KiB
hand_20.txt AC 49 ms 3480 KiB
hand_21.txt TLE > 2000 ms 4308 KiB
hand_22.txt AC 209 ms 12360 KiB
hand_23.txt AC 288 ms 3516 KiB
hand_24.txt TLE > 2000 ms 3672 KiB
hand_25.txt AC 1 ms 3516 KiB
hand_26.txt AC 1 ms 3612 KiB
hand_27.txt AC 851 ms 4256 KiB
hand_28.txt AC 93 ms 3468 KiB
random_00.txt WA 107 ms 3424 KiB
random_01.txt WA 184 ms 3572 KiB
random_02.txt WA 470 ms 3488 KiB
random_03.txt TLE > 2000 ms 3944 KiB
random_04.txt AC 415 ms 3700 KiB
random_05.txt AC 123 ms 3556 KiB
random_06.txt WA 148 ms 3572 KiB
random_07.txt WA 801 ms 3700 KiB
random_08.txt TLE > 2000 ms 3780 KiB
random_09.txt TLE > 2000 ms 4236 KiB
random_10.txt WA 134 ms 3572 KiB
random_11.txt WA 138 ms 3556 KiB
random_12.txt WA 997 ms 3708 KiB
random_13.txt TLE > 2000 ms 3436 KiB
random_14.txt TLE > 2000 ms 4228 KiB
random_15.txt AC 75 ms 3572 KiB
random_16.txt WA 222 ms 3580 KiB
random_17.txt AC 189 ms 3424 KiB
random_18.txt TLE > 2000 ms 3928 KiB
random_19.txt TLE > 2000 ms 4076 KiB