ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Go
// https://www.acmicpc.net/problem/20206
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
reader := bufio.NewReader(os.Stdin)
writer := bufio.NewWriter(os.Stdout)
defer writer.Flush()
var a, b, c float64
fmt.Fscanln(reader, &a, &b, &c)
var x1, x2, y1, y2 float64
fmt.Fscanln(reader, &x1, &x2, &y1, &y2)
fmt.Fprintln(writer, checkSecurity(a, b, c, x1, x2, y1, y2))
}
func checkSecurity(a, b, c, x1, x2, y1, y2 float64) string {
if x1 > x2 {
x1, x2 = x2, x1
}
if y1 > y2 {
y1, y2 = y2, y1
}
y := (a*x1 + c) / (-b)
if y < y2 && y1 < y {
return "Poor"
}
y = (a*x2 + c) / (-b)
if y < y2 && y1 < y {
return "Poor"
}
x := (b*y1 + c) / (-a)
if x < x2 && x1 < x {
return "Poor"
}
x = (b*y2 + c) / (-a)
if x < x2 && x1 < x {
return "Poor"
}
return "Lucky"
}
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 2110๋ฒ / ๊ณต์ ๊ธฐ ์ค์น [Go][Python3] (0) | 2020.11.25 |
---|---|
BOJ / 20207๋ฒ / ๋ฌ๋ ฅ [Go] (0) | 2020.11.24 |
BOJ / 20205๋ฒ / ๊ต์๋ ๊ทธ๋ฆผ์ด ๊นจ์ง๋๋ฐ์? [Go] (0) | 2020.11.22 |
BOJ / 2805๋ฒ / ๋๋ฌด ์๋ฅด๊ธฐ [Go][Python3] (0) | 2020.11.21 |
BOJ / 1654๋ฒ / ๋์ ์๋ฅด๊ธฐ [Go][Python3] (0) | 2020.11.20 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- ์๊ณ ๋ฆฌ์ฆ
- ๋ถํ ์ ๋ณต
- dp
- ๋ฐ๋
- Algorithm
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- AWS
- ๋ธ๋ฃจํธํฌ์ค
- python3
- Golang
- ์คํ
- baekjoon
- ํ๋ก์ด๋์์ฌ
- dfs
- BOJ
- java
- ๋งฅ๋ถํ๋ก
- ballet
- MongoDB
- Macbook pro 2012 mid 13
- ์๋ฐ
- ํ
- ๋ฐฑ์ค
- ๋งฅ๋ถ
- ๋ชฝ๊ณ ๋๋น
- go
- BFS
- ํด์๋งต
- ์ด๋ถํ์
- ์๊ฐ๊ต์ฒด
- Total
- Today
- Yesterday