結果
| 問題 |
No.2372 既視感
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-17 16:02:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 897 bytes |
| コンパイル時間 | 1,783 ms |
| コンパイル使用メモリ | 179,248 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-01 16:00:31 |
| 合計ジャッジ時間 | 2,842 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll N, K, Q; cin >> N >> K >> Q;
stack<string>A;
while (Q--) {
int t; cin >> t;
if (t == 1) {
string T; cin >> T;
A.push(T);
}
else {
set<string>S;
stack<string>B = A;
while (!B.empty() && S.size() < N) {
S.insert(B.top()); B.pop();
}
string T; ll time;
ll ans = 0, sum = 0;
for (int i = 0; i < 6; i++) {
cin >> T >> time;
if (S.find(T) == S.end()) {
sum += time;
}
else sum += min(time, K);
if (sum <= 60) {
A.push(T);
ans++;
}
}
cout << ans << endl;
}
}
}