結果
問題 | No.842 初詣 |
ユーザー |
|
提出日時 | 2020-12-20 17:31:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 345 bytes |
コンパイル時間 | 1,729 ms |
コンパイル使用メモリ | 167,724 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-21 11:54:00 |
合計ジャッジ時間 | 2,497 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int64_t xs[7]; for (int i = 0; i < 7; i++) cin >> xs[i]; int64_t ys[] = {500, 100, 50, 10, 5, 1}; for (int i = 0; i < 6; i++) { int64_t x = min(xs[6] / ys[i], xs[i]); xs[6] -= x * ys[i]; } if (xs[6]) cout << "NO" << endl; else cout << "YES" << endl; return 0; }