結果

問題 No.842 初詣
ユーザー mamekinmamekin
提出日時 2019-06-28 21:24:53
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 869 bytes
コンパイル時間 979 ms
コンパイル使用メモリ 114,788 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-14 21:33:18
合計ジャッジ時間 1,893 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,504 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

const int COIN[] = {500, 100, 50, 10, 5, 1};

int main()
{
    vector<int> v(6);
    for(int i=0; i<6; ++i)
        cin >> v[i];

    int sum;
    cin >> sum;
    for(int i=0; i<6; ++i){
        int a = min(sum / COIN[i], v[i]);
        sum -= COIN[i] * a;
    }
    if(sum == 0)
        cout << "YES" << endl;
    else
        cout << "No" << endl;

    return 0;
}
0