ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Go
// https://www.acmicpc.net/problem/4796
package main
import (
"bufio"
"fmt"
"math"
"os"
)
func main() {
reader := bufio.NewReader(os.Stdin)
writer := bufio.NewWriter(os.Stdout)
defer writer.Flush()
for i := 1; ; i++ {
var l, p, v int
fmt.Fscanln(reader, &l, &p, &v)
if l == 0 && p == 0 && v == 0 {
break
}
fmt.Fprintf(writer, "Case %d: %d\n", i, (v/p)*l+int(math.Min(float64(v%p), float64(l))))
}
}
๐จ Python3
# https://www.acmicpc.net/problem/4796
import sys
if __name__ == "__main__":
i = 1
while True:
l, p, v = list(map(int, sys.stdin.readline().split()))
if l == 0 and p == 0 and v == 0:
break
print("Case {}: {}".format(i, (v//p)*l + min(v%p, l)))
i += 1
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 1026๋ฒ / ๋ณด๋ฌผ [Go][Python3] (0) | 2021.03.03 |
---|---|
BOJ / 13305๋ฒ / ์ฃผ์ ์ [Go][Python3] (0) | 2021.03.02 |
BOJ / 16165๋ฒ / ๊ฑธ๊ทธ๋ฃน ๋ง์คํฐ ์ค์์ด [Go][Python3] (0) | 2021.02.28 |
BOJ / 11478๋ฒ / ์๋ก ๋ค๋ฅธ ๋ถ๋ถ ๋ฌธ์์ด์ ๊ฐ์ [Go][Python3] (0) | 2021.02.27 |
BOJ / 1789๋ฒ / ์๋ค์ ํฉ [Go][Python3] (0) | 2021.02.26 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- Macbook pro 2012 mid 13
- MongoDB
- Golang
- java
- ballet
- ํ๋ก์ด๋์์ฌ
- BFS
- ์๊ฐ๊ต์ฒด
- ๋งฅ๋ถํ๋ก
- ๋ธ๋ฃจํธํฌ์ค
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- ์ด๋ถํ์
- ๋ชฝ๊ณ ๋๋น
- go
- ์๋ฐ
- python3
- baekjoon
- ํ
- ๋ถํ ์ ๋ณต
- ๋ฐ๋
- ๋ฐฑ์ค
- dfs
- dp
- Algorithm
- BOJ
- ์๊ณ ๋ฆฌ์ฆ
- ๋งฅ๋ถ
- AWS
- ํด์๋งต
- ์คํ
- Total
- Today
- Yesterday