結果

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

テストケース

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

ソースコード

diff #

package main

import "fmt"

//import "math"

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