結果

問題 No.3641 OHO SHI KA TSU(Waiting ver.)
コンテスト
ユーザー mupa bihu
提出日時 2026-08-25 15:40:19
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.90.0)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 570 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,643 ms
コンパイル使用メモリ 363,776 KB
実行使用メモリ 127,232 KB
最終ジャッジ日時 2026-08-25 15:40:35
合計ジャッジ時間 8,235 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
サンプル 0 % RE * 1
小課題1 20 % WA * 1 RE * 4
小課題2 30 % AC * 1 WA * 4 RE * 6
小課題3 30 % AC * 1 WA * 1 RE * 8
小課題4 20 % AC * 3 WA * 4 RE * 18
合計 0 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;

int main(){
	int a,b,c;
	cin>>a>>b>>c;
	map<int,queue<int> > h;
	vector<int> ans(b);
	for(int i=0;i<c;i++){
		int d,e,f;
		cin>>d>>e>>f;
		if(d==1){
			if(h.count(f-1)){
				h.at(f-1).push(e);
			}
			else{
				queue<int> k;
				k.push(e);
				h[f-1]=k;
			}
		}
		else{
			int g=h.at(e-1).front();
			ans.at(h.at(e-1).front()-1)++;
			h.at(e-1).pop();
			if(h.count(f-1)){
				h.at(f-1).push(g);
			}
			else{
				queue<int> k;
				k.push(f-1);
				h[f-1]=k;
			}
		}
	}
	for(int j=0;j<b;j++){
		cout<<ans.at(j)<<endl;
	}
}
0