結果
問題 | No.842 初詣 |
ユーザー |
|
提出日時 | 2020-04-09 20:36:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 598 bytes |
コンパイル時間 | 1,523 ms |
コンパイル使用メモリ | 166,008 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 20:21:23 |
合計ジャッジ時間 | 2,285 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; using ll = long long ; using P = pair<ll,ll> ; const ll INF = 10000000000; const int MOD = 1000000007; int main(){ int a,b,c,d,e,f,g; cin >> a >>b >> c >> d >> e >> f >> g; if(g/500 > a) g -= 500*a; else g %= 500; if(g/100 > b) g -= 100*b; else g %= 100; if(g/50 > c) g -= 50*c; else g %= 50; if(g/10 > d) g -= 10*d; else g %= 10; if(g/5 > e) g -= 5*e; else g %= 5; if(g > f) g -= f; else g %= 1; cout << (g==0 ? "YES" : "NO") << endl; return 0; }