結果
問題 |
No.2372 既視感
|
ユーザー |
![]() |
提出日時 | 2023-06-24 12:36:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,169 bytes |
コンパイル時間 | 1,894 ms |
コンパイル使用メモリ | 197,752 KB |
最終ジャッジ日時 | 2025-02-15 01:55:41 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 25 WA * 1 |
ソースコード
// 嘘解法 (WA) // 既視感の更新処理を 1 問ずつやっている #include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); int N, K, Q; cin >> N >> K >> Q; vector<string> A; for (int i = 0; i < Q; i++) { int q; cin >> q; if (q == 1) { string s; cin >> s; A.push_back(s); } else { int ans = 0; int sum_d = 0; for (int k = 0; k < 6; k++) { string t; int d; cin >> t >> d; int M = A.size(); int j = max(0, (M - 1) - N + 1); for (int l = j; l < M; l++) { if (A[l] == t) { d = min(d, K); break; } } sum_d += d; if (sum_d <= 60) { ans++; A.push_back(t); } } cout << ans << '\n'; } } return 0; }