結果
| 問題 | No.3641 OHO SHI KA TSU(Waiting ver.) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-25 16:47:02 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 837 bytes |
| 記録 | |
| コンパイル時間 | 1,306 ms |
| コンパイル使用メモリ | 220,472 KB |
| 実行使用メモリ | 1,307,008 KB |
| 最終ジャッジ日時 | 2026-08-25 16:47:15 |
| 合計ジャッジ時間 | 6,840 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| サンプル | 0 % | AC * 1 |
| 小課題1 | 20 % | AC * 5 |
| 小課題2 | 30 % | AC * 11 |
| 小課題3 | 30 % | AC * 6 RE * 4 |
| 小課題4 | 20 % | AC * 14 RE * 7 MLE * 2 -- * 2 |
| 合計 | 50 点 |
ソースコード
#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
using i128 = __int128;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int N, M, Q;
std::cin >> N >> M >> Q;
std::unordered_map<int, std::deque<int>> q(N + 1);
std::vector<int> ans(M + 1);
while (Q--) {
int op, x, y;
std::cin >> op >> x >> y;
if (op == 1) {
//! 人x排到y末尾
q[y].push_back(x);
} else {
//! x队头购买商品,然后到t末尾
int z = q[x].front();
q[x].pop_front();
ans[z]++;
q[y].push_back(z);
}
}
for (int i = 1; i <= M; i++) {
std::cout << ans[i] << '\n';
}
return 0;
}