結果
問題 | No.842 初詣 |
ユーザー |
![]() |
提出日時 | 2019-09-05 12:47:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 611 bytes |
コンパイル時間 | 910 ms |
コンパイル使用メモリ | 82,980 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-03 14:18:41 |
合計ジャッジ時間 | 1,722 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 10 |
ソースコード
#include<iostream> #include<algorithm> #include <vector> #include<cmath> #include<iomanip> #include<queue> using namespace std; typedef long long int lont; int main() { int A, B, C, D, E, F, G; cin >> A >> B >> C >> D >> E >> F >> G; while (G >= A && A >= 1) { G -= 500; A--; } while (G >= B && B >= 1) { G -= 100; B--; } while (G >= C && C >= 1) { G -= 50; C--; } while (G >= D && D >= 1) { G -= 10; D--; } while (G >= E && E >= 1) { G -= 5; E--; } while (G >= F && F >= 1) { G -= 1; F--; } if (G==0) { cout << "YES" << endl; } else { cout << "NO" << endl; } }