結果
問題 | No.2372 既視感 |
ユーザー |
![]() |
提出日時 | 2023-07-07 22:20:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 974 bytes |
コンパイル時間 | 1,939 ms |
コンパイル使用メモリ | 198,852 KB |
最終ジャッジ日時 | 2025-02-15 07:42:16 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#include<bits/stdc++.h>using namespace std;int main() {int n, k, q;cin >> n >> k >> q;vector<string> a;while (q--) {int type;cin >> type;if (type == 1) {string s;cin >> s;a.emplace_back(s);}else {vector<string> t(6);vector<int> d(6);for (int i = 0; i < 6; i++) {cin >> t[i] >> d[i];int m = a.size();int j = max(0, m - n);for (int l = j; l < m; l++) {if (t[i] == a[l])d[i] = min(d[i], k);}}int total_time = 0;for(int i = 0; i < 7; i++){if((i == 6) || total_time + d[i] > 60){for(int j = 0; j < i; j++)a.emplace_back(t[j]);cout << i << endl;break;}total_time += d[i];}}}}