結果

問題 No.1015 おつりは要らないです
ユーザー tailstails
提出日時 2020-04-15 21:41:28
言語 cLay
(20240104-1)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 2,198 ms
コンパイル使用メモリ 164,268 KB
実行使用メモリ 4,984 KB
最終ジャッジ日時 2023-09-19 00:36:31
合計ジャッジ時間 4,693 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 39 ms
4,868 KB
testcase_11 AC 40 ms
4,900 KB
testcase_12 AC 38 ms
4,932 KB
testcase_13 AC 39 ms
4,972 KB
testcase_14 AC 41 ms
4,968 KB
testcase_15 AC 38 ms
4,896 KB
testcase_16 AC 38 ms
4,912 KB
testcase_17 AC 40 ms
4,896 KB
testcase_18 AC 39 ms
4,828 KB
testcase_19 AC 38 ms
4,876 KB
testcase_20 AC 34 ms
4,820 KB
testcase_21 AC 34 ms
4,808 KB
testcase_22 AC 33 ms
4,792 KB
testcase_23 AC 33 ms
4,772 KB
testcase_24 AC 35 ms
4,808 KB
testcase_25 AC 34 ms
4,840 KB
testcase_26 AC 34 ms
4,848 KB
testcase_27 AC 33 ms
4,784 KB
testcase_28 AC 33 ms
4,964 KB
testcase_29 AC 34 ms
4,836 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 10 ms
4,376 KB
testcase_32 AC 9 ms
4,380 KB
testcase_33 AC 7 ms
4,984 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:129:16: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     a<0?f("Yes"):g(z,1e4)||g(y,5e3)||g(x,1e3)||f("No");
                ^
main.cpp:129:54: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     a<0?f("Yes"):g(z,1e4)||g(y,5e3)||g(x,1e3)||f("No");
                                                      ^

ソースコード

diff #

ll n,x,y,z,a,t;
priority_queue<ll>q;
ll f(char*s){wt(s);exit(0);}
ll g(ll&v,ll m){return v?v-=t=min(v,a/m)?:1,a-=m*t,1:0;}
{
	rd(n,x,y,z);
	rep(n)rd(a),q.push(a);
	for(;;){
		a=q.top();q.pop();
		a<0?f("Yes"):g(z,1e4)||g(y,5e3)||g(x,1e3)||f("No");
		q.push(a);
	}
}
0