結果
問題 | No.842 初詣 |
ユーザー | dnish |
提出日時 | 2019-06-28 21:32:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,117 bytes |
コンパイル時間 | 1,564 ms |
コンパイル使用メモリ | 166,208 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 04:25:26 |
合計ジャッジ時間 | 2,334 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include "bits/stdc++.h" #define REP(i, n, N) for(ll i = n; i < (N); i++) #define p(s) cout << (s) << endl #define p2(a, b) cout << (a) <<" "<< (b) << endl using namespace std; typedef long long ll; ll mod = 1e9+7; ll inf = 1e18; int main() { ll a, b, c, d, e, f, g; cin>>a>>b>>c>>d>>e>>f>>g; REP(A,0,a+1){ ll now = 500 * A; REP(B,0,b+1){ now += 100 * B; REP(C,0,c+1){ now += 50 * C; REP(D,0,d+1){ now += 10 * D; REP(E,0,e+1){ now += 5 * E; REP(F,0,f+1){ now += F; if(now == g) { p("YES"); return 0; } now -= F; } now -= 5 * E; } now -= 10 * D; } now -= 50 * C; } now -= 100 * B; } } p("NO"); return 0; }