結果
問題 |
No.2372 既視感
|
ユーザー |
![]() |
提出日時 | 2023-07-20 18:01:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,043 bytes |
コンパイル時間 | 1,733 ms |
コンパイル使用メモリ | 197,868 KB |
最終ジャッジ日時 | 2025-02-15 15:55:57 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 WA * 14 RE * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++) #define rrep(i, n, a) for (int i = (int)(n); i >= (int)(a); i--) void solve(){ int n,k,q; cin >> n >> k >> q; string t[6]; int d[6]; vector<string> seen; while(q--){ int c; cin >> c; if(c == 1){ string s; cin >> s; seen.push_back(s); } else { rep(i,0,6) cin >> t[i] >> d[i]; int ans = 0; int time = 0; rep(i,0,6){ rrep(j,seen.size()-1, max((unsigned long)1, seen.size()-n-1)){ if(seen[j] == t[i]) d[i] = min(d[i],k); } } rep(i,0,6){ if(time+d[i] <= 60){ time += d[i]; ans++; } else break; } cout << ans << '\n'; } } } int main(){ ios::sync_with_stdio(false); cin.tie(0); solve(); return 0; }