結果
問題 |
No.176 2種類の切手
|
ユーザー |
|
提出日時 | 2015-03-29 22:22:54 |
言語 | Go1.4 (1.4.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 596 bytes |
コンパイル時間 | 345 ms |
コンパイル使用メモリ | 32,384 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-11-25 00:11:18 |
合計ジャッジ時間 | 13,768 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 TLE * 6 |
ソースコード
package main import ( "bufio" "os" "strconv" "fmt" ) var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextLine() string { s.Split(bufio.ScanLines) s.Scan() if nil != s.Err() { panic(s.Err()) } return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func main() { A := nextInt() B := nextInt() T := nextInt() mn := T + A for i := 0; i*A < T+A; i++ { D := T - A * i buy := i*A+((D+B-1)/B)*B if mn > buy { mn = buy } } fmt.Println(mn) }