結果
問題 | No.842 初詣 |
ユーザー |
![]() |
提出日時 | 2020-08-10 09:53:57 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 668 bytes |
コンパイル時間 | 2,018 ms |
コンパイル使用メモリ | 191,980 KB |
最終ジャッジ日時 | 2025-01-12 19:35:48 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int A, B, C, D, E, F, G; cin >> A >> B >> C >> D >> E >> F >> G; for (int a = 0; a < A + 1; a++) { for (int b = 0; b < B + 1; b++) { for (int c = 0; c < C + 1; c++) { for (int d = 0; d < D + 1; d++) { for (int e = 0; e < E + 1; e++) { for (int f = 0; f < F + 1; f++) { if (a * 500 + b * 100 + c * 50 + d * 10 + 5 * e + f == G) { cout << "YES" << '\n'; return 0; } } } } } } } cout << "NO" << '\n'; return 0; }