結果

問題 No.2372 既視感
ユーザー random contestantrandom contestant
提出日時 2023-07-07 21:53:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 1,065 bytes
コンパイル時間 4,603 ms
コンパイル使用メモリ 264,424 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-28 23:03:41
合計ジャッジ時間 5,638 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 8 ms
4,380 KB
testcase_09 AC 3 ms
4,376 KB
testcase_10 AC 6 ms
4,380 KB
testcase_11 AC 3 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 9 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 5 ms
4,380 KB
testcase_16 AC 4 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 10 ms
4,376 KB
testcase_24 AC 9 ms
4,380 KB
testcase_25 AC 10 ms
4,380 KB
testcase_26 AC 10 ms
4,380 KB
testcase_27 AC 9 ms
4,376 KB
testcase_28 AC 23 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
using vl = vector<ll>;
using vvl = vector<vl>;
using P = pair<ll,ll>;
#define pb push_back
#define int long long
#define double long double
#define INF (ll) 3e18
// Ctrl + Shift + B コンパイル
// Ctrl + C 中断
// ./m 実行


signed main(){
  int n, k, q;
  cin >> n >> k >> q;
  deque<string> deq;
  while(q--){
    int T; cin >> T;
    if (T == 1){
      string d; cin >> d;
      deq.push_back(d);
    }
    if (T == 2){
      vector<string> t(6);
      vl d(6);
      rep(i, 6) cin >> t[i] >> d[i];
      int solve = 0;
      int time = 0;
      rep(i, 6){
        int find = 0;
        for(auto x : deq) if (x == t[i]) find = 1;
        if (find) time += min(d[i], k);
        else time += d[i];
        if (time <= 60) solve++;
        if (time <= 60) deq.push_back(t[i]);
      }
      cout << solve << endl;
    }
    while(deq.size() > n) deq.pop_front();
  }
}
0