結果
問題 |
No.842 初詣
|
ユーザー |
![]() |
提出日時 | 2019-07-01 21:25:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 533 bytes |
コンパイル時間 | 1,455 ms |
コンパイル使用メモリ | 165,812 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 06:38:54 |
合計ジャッジ時間 | 2,054 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1e9 + 7; const int inf = (1 << 30) - 1; const ll infll = (1LL << 61) - 1; int yen[6] = {500, 100, 50, 10, 5, 1}, have[6]; int main() { for (int i = 0; i < 6; i++) cin >> have[i]; int f; cin >> f; for (int i = 0; i < 6; i++) { int use = f / yen[i]; f -= yen[i] * min(use, have[i]); //cout << f << endl; } if (f == 0) cout << "YES" << endl; else cout << "NO" << endl; }