結果

問題 No.2804 Fixer And Ratism
ユーザー tailstails
提出日時 2024-07-12 22:08:13
言語 cLay
(20240714-1)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 4,853 ms
コンパイル使用メモリ 187,948 KB
実行使用メモリ 8,132 KB
最終ジャッジ日時 2024-07-12 22:08:21
合計ジャッジ時間 6,449 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 3 ms
7,488 KB
testcase_02 AC 3 ms
6,948 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 3 ms
6,944 KB
testcase_10 WA -
testcase_11 AC 17 ms
6,940 KB
testcase_12 WA -
testcase_13 AC 5 ms
6,940 KB
testcase_14 AC 13 ms
8,132 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 7 ms
6,944 KB
testcase_18 WA -
testcase_19 AC 3 ms
6,944 KB
testcase_20 WA -
testcase_21 AC 21 ms
6,940 KB
testcase_22 WA -
testcase_23 AC 30 ms
8,008 KB
testcase_24 WA -
testcase_25 AC 30 ms
6,940 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 30 ms
6,944 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 30 ms
6,940 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

LHeap<ll>h;
h.malloc(100,1);
map<string,ll>m;
string a[100];
ll@n,@q,b=0;
rep(q){
	ll@t;
if(t<1||t>3)exit(8);
	if(t==1){
		string@s;
if(m.find(s)!=m.end())exit(9);
		ll@r;
		ll d=b++;
if(b>100)exit(3);
		h.change(d,r);
		m[s]=d;
		a[d]=s;
	}
	if(t==2){
		ll@x;
		n-=x;
if(n<1)exit(4);
	}
	if(t==3){
		string@s;
		ll@x;
if(m.find(s)==m.end())exit(7);
		ll d=m[s];
if(a[d]=="")exit(6);
		ll r=h.val[d];
		if(r<4001){
			h.change(d,r+4001);
		}
		n+=x;
	}
	while(h.size>n){
		ll d=h.pop();
if(a[d]=="")exit(5);
		wt(a[d]);
m.erase(a[d]);
a[d]="";
	}
}
0