結果

問題 No.842 初詣
ユーザー silopysilopy
提出日時 2019-08-11 17:42:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 66,700 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 21:18:17
合計ジャッジ時間 1,635 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
using lint=int64_t;

int main()
{
	int input[10]{};
	int yen[]={500,100,50,10,5,1};

	for(int i=0;i<7;i++)
		cin >> input[i];
	
	int sum=input[6];
	for(int i=0;i<6;i++)
	{
		int sub=0;
		for(int j=0;j<=input[i] && sub<=sum;j++)
			sub+=yen[i];

		sum-=sub;
	}

	if(sum==0)cout << "YES";
	else cout << "NO";
	cout << endl;
	return 0;
}
0