ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Go
// https://www.acmicpc.net/problem/9372
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
reader := bufio.NewReader(os.Stdin)
writer := bufio.NewWriter(os.Stdout)
defer writer.Flush()
var t int
fmt.Fscanln(reader, &t)
for i := 0; i < t; i++ {
var n, m int
fmt.Fscanln(reader, &n, &m)
for j := 0; j < m; j++ {
var a, b int
fmt.Fscanln(reader, &a, &b)
}
fmt.Fprintln(writer, n-1) // ์คํจ๋ํธ๋ฆฌ: n๊ฐ์ ์ ์ ์ ๊ฐ์ง๋ ๊ทธ๋ํ์ ์ต์ ๊ฐ์ ์ ์๋ (n-1)๊ฐ์ด๋ค.
}
}
๐จ Python3
# https://www.acmicpc.net/problem/9372
import sys
if __name__ == "__main__":
t = int(sys.stdin.readline())
for i in range(t):
n, m = list(map(int, sys.stdin.readline().split()))
for j in range(m):
a, b = sys.stdin.readline().split()
print(n-1)
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 11403๋ฒ / ๊ฒฝ๋ก ์ฐพ๊ธฐ [Go][Python3] (0) | 2021.01.04 |
---|---|
BOJ / 2178๋ฒ / ๋ฏธ๋ก ํ์ [Go][Python3] (0) | 2021.01.03 |
BOJ / 2740๋ฒ / ํ๋ ฌ ๊ณฑ์ [Go][Python3] (0) | 2021.01.01 |
BOJ / 1629๋ฒ / ๊ณฑ์ [Go][Python3] (0) | 2020.12.31 |
BOJ / 1780๋ฒ / ์ข ์ด์ ๊ฐ์ [Go][Python3] (0) | 2020.12.30 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- ํ
- BOJ
- ๋ถํ ์ ๋ณต
- Golang
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- ballet
- ์ด๋ถํ์
- ๋ฐฑ์ค
- ์๋ฐ
- dp
- dfs
- ์คํ
- BFS
- Macbook pro 2012 mid 13
- ์๊ณ ๋ฆฌ์ฆ
- ๋ชฝ๊ณ ๋๋น
- Algorithm
- MongoDB
- go
- python3
- ๋ธ๋ฃจํธํฌ์ค
- AWS
- ์๊ฐ๊ต์ฒด
- ๋งฅ๋ถ
- java
- ํ๋ก์ด๋์์ฌ
- ๋งฅ๋ถํ๋ก
- baekjoon
- ๋ฐ๋
- ํด์๋งต
- Total
- Today
- Yesterday