結果
問題 | No.2804 Fixer And Ratism |
ユーザー |
![]() |
提出日時 | 2024-07-13 01:51:34 |
言語 | cLay (20241019-1) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 546 bytes |
コンパイル時間 | 4,126 ms |
コンパイル使用メモリ | 186,852 KB |
実行使用メモリ | 8,264 KB |
最終ジャッジ日時 | 2024-07-13 01:51:40 |
合計ジャッジ時間 | 6,333 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
ソースコード
LHeap<ll>h;h.malloc(100,1);map<string,ll>m;string a[100];ll@n,@q,b=0,o[10],v,w;rep(q){ll@t;if(t==1){string@s;ll@r;ll d=b++;h.change(d,r);m[s]=d;a[d]=s;}if(t==2){ll@x;n-=x;}if(t==3){string@s;ll@x;ll d=m[s];ll r=h.val[d];if(r<5000){h.change(d,r+5000);}n+=x;}v=w=0;while(h.size>n){ll d=h.pop();ll r=h.val[d];if(r<5000){o[w++]=d;}else{while(v<w&&h.val[o[v]]<r-5000){wt(a[o[v]]);++v;}wt(a[d]);}}while(v<w){wt(a[o[v]]);++v;}}