結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 38 ms
4,848 KB
testcase_11 AC 40 ms
4,928 KB
testcase_12 AC 38 ms
4,928 KB
testcase_13 AC 39 ms
4,920 KB
testcase_14 AC 41 ms
4,948 KB
testcase_15 AC 38 ms
5,016 KB
testcase_16 AC 39 ms
5,076 KB
testcase_17 AC 40 ms
4,880 KB
testcase_18 AC 38 ms
4,832 KB
testcase_19 AC 39 ms
4,944 KB
testcase_20 AC 34 ms
4,840 KB
testcase_21 AC 34 ms
4,888 KB
testcase_22 AC 33 ms
4,988 KB
testcase_23 AC 32 ms
4,808 KB
testcase_24 AC 34 ms
4,848 KB
testcase_25 AC 33 ms
4,808 KB
testcase_26 AC 34 ms
4,884 KB
testcase_27 AC 33 ms
5,016 KB
testcase_28 AC 33 ms
4,816 KB
testcase_29 AC 33 ms
4,980 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 10 ms
4,380 KB
testcase_32 AC 9 ms
4,380 KB
testcase_33 AC 7 ms
5,168 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 2 ms
4,376 KB
testcase_36 AC 1 ms
4,376 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,10)||g(y,5)||g(x,1)||f("No");
                ^
main.cpp:129:49: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     a<0?f("Yes"):g(z,10)||g(y,5)||g(x,1)||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*=1000))?: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,10)||g(y,5)||g(x,1)||f("No");
		q.push(a);
	}
}
0