結果

問題 No.32 貯金箱の憂鬱
ユーザー chankou0920chankou0920
提出日時 2017-09-25 16:14:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 475 bytes
コンパイル時間 2,366 ms
コンパイル使用メモリ 100,340 KB
実行使用メモリ 22,944 KB
最終ジャッジ日時 2023-09-30 12:42:05
合計ジャッジ時間 3,760 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
20,724 KB
testcase_01 AC 55 ms
20,604 KB
testcase_02 AC 56 ms
22,944 KB
testcase_03 AC 55 ms
22,696 KB
testcase_04 AC 54 ms
20,744 KB
testcase_05 AC 54 ms
22,728 KB
testcase_06 AC 55 ms
18,832 KB
testcase_07 AC 55 ms
20,744 KB
testcase_08 AC 55 ms
20,788 KB
testcase_09 AC 54 ms
20,592 KB
testcase_10 AC 55 ms
22,732 KB
testcase_11 AC 54 ms
20,924 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Program {
	public static void Main(string[] args)
	{
		int count = 0;
		int l = int.Parse(Console.ReadLine());
		int m = int.Parse(Console.ReadLine());
		int n = int.Parse(Console.ReadLine());
		int[] coins = {100, 25, 1};
		int money = l * coins[0] + m * coins[1] + n * coins[2];
		money %= 1000;
		for (int i = 0; i < coins.Length; i++) {
			count += money / coins[i];
			money %= coins[i];
		}
		count += money;
		Console.WriteLine(count);
	}
}
0