結果
問題 | No.842 初詣 |
ユーザー |
![]() |
提出日時 | 2020-03-30 16:33:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 1,896 ms |
コンパイル使用メモリ | 166,476 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-13 01:11:04 |
合計ジャッジ時間 | 2,473 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int A[6], G; cin >> A[0] >> A[1] >> A[2] >> A[3] >> A[4] >> A[5] >> G; int v[6] = { 500, 100, 50, 10, 5, 1 }; for( int i = 0; i < 6; i++ ) { G -= min( A[i] * v[i], G / v[i] * v[i] ); } string ans = "NO"; if( G == 0 ) ans = "YES"; cout << ans << endl; }