結果

問題 No.2372 既視感
ユーザー random contestantrandom contestant
提出日時 2023-07-07 21:40:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,057 bytes
コンパイル時間 4,483 ms
コンパイル使用メモリ 266,224 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-28 22:42:10
合計ジャッジ時間 5,932 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 3 ms
4,380 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 7 ms
4,384 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 13 ms
4,380 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 13 ms
4,376 KB
testcase_28 AC 24 ms
4,380 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++;
      }
      cout << solve << endl;
      rep(i, 6) deq.push_back(t[i]);
    }
    while(deq.size() > n) deq.pop_front();
  }
}
0