結果
| 問題 |
No.842 初詣
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-06-28 21:35:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 513 bytes |
| コンパイル時間 | 1,584 ms |
| コンパイル使用メモリ | 167,252 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-02 04:27:51 |
| 合計ジャッジ時間 | 2,338 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d, e, f, g;
cin >> a >> b >> c >> d >> e >> f >> g;
while ( g >= 500*a && a > 0 ) { g -= 500; a--; }
while ( g >= 100*b && b > 0 ) { g -= 100; b--; }
while ( g >= 50*c && c > 0 ) { g -= 50; c--; }
while ( g >= 10*d && d > 0 ) { g -= 10; d--; }
while ( g >= 5*e && e > 0 ) { g -= 5; e--; }
while ( g >= 1*f && f > 0 ) { g -= 1; f--; }
string ans = ( g == 0 ) ? "YES" : "NO";
cout << ans << endl;
return 0;
}