結果

問題 No.842 初詣
ユーザー doraharo
提出日時 2019-06-30 18:12:19
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 1,040 ms
コンパイル使用メモリ 157,812 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 11:19:12
合計ジャッジ時間 1,743 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    int a[7];
    int c[6] = {500, 100, 50, 10, 5, 1};
    for (int i = 0; i < 7; ++i) cin >> a[i];
    for (int i = 0; i < 6; ++i) {
        a[6] -= min(a[i] * c[i], (a[6] / c[i]) * c[i]);
    }
    if (a[6] == 0) cout << "YES" << endl;
    else cout << "NO" << endl;
}
0