結果
問題 | No.1015 おつりは要らないです |
ユーザー | tempura_pp |
提出日時 | 2020-04-03 21:24:37 |
言語 | C++17 (gcc 13.2.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,144 bytes |
コンパイル時間 | 1,038 ms |
コンパイル使用メモリ | 117,904 KB |
実行使用メモリ | 4,504 KB |
最終ジャッジ日時 | 2023-09-16 00:07:51 |
合計ジャッジ時間 | 2,746 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 1 ms
4,376 KB |
testcase_08 | AC | 2 ms
4,376 KB |
testcase_09 | AC | 1 ms
4,376 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 2 ms
4,380 KB |
testcase_16 | AC | 2 ms
4,376 KB |
testcase_17 | AC | 2 ms
4,380 KB |
testcase_18 | AC | 2 ms
4,376 KB |
testcase_19 | AC | 2 ms
4,376 KB |
testcase_20 | AC | 13 ms
4,380 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 12 ms
4,376 KB |
testcase_24 | WA | - |
testcase_25 | AC | 12 ms
4,376 KB |
testcase_26 | WA | - |
testcase_27 | AC | 13 ms
4,384 KB |
testcase_28 | AC | 13 ms
4,376 KB |
testcase_29 | AC | 12 ms
4,380 KB |
testcase_30 | AC | 2 ms
4,376 KB |
testcase_31 | WA | - |
testcase_32 | AC | 2 ms
4,380 KB |
testcase_33 | AC | 1 ms
4,376 KB |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
ソースコード
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include<stack> #include<map> #include<set> #include<bitset> #include<functional> #include<assert.h> #include<numeric> using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) using ll = long long; constexpr int inf=1e9+7; constexpr ll longinf=1LL<<60 ; constexpr ll mod=1e9+7 ; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin>>n; ll x,y,z; cin>>x>>y>>z; rep(i,n){ ll a; cin>>a; int t = max(a/10000,z); a -= t*10000; z -= t; t = max(a/5000,y); a -= t*5000; y -= t; t = max(a/1000,x); a -= t*1000; x -= t; if(a<1000 && x){ x--; } else if(a<5000 && y){ y--; } else if(a<10000 && z){ z--; } else { cout<<"No"<<endl; return 0; } } cout<<"Yes"<<endl; return 0; }