結果

問題 No.32 貯金箱の憂鬱
ユーザー a_saikia_saiki
提出日時 2017-06-29 16:43:13
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 9,830 ms
コンパイル使用メモリ 228,880 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 04:53:51
合計ジャッジ時間 10,578 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,816 KB
testcase_02 AC 1 ms
6,816 KB
testcase_03 AC 2 ms
6,816 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import "fmt"

func main() {
	var l, m, n int
	fmt.Scanf("%v", &l)
	fmt.Scanf("%v", &m)
	fmt.Scanf("%v", &n)
	sum := l*100 + m*25 + n
	r := map[int]int{1000: 0, 100: 0, 25: 0, 1: 0}
	for k := range r {
		r[k] = sum / k
		sum = sum - k*r[k]
		if sum < 0 {
			break
		}
	}
	fmt.Printf("%d\n", r[100]+r[25]+r[1])
}
0