ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Go
// https://www.acmicpc.net/problem/10867
package main
import (
"bufio"
"fmt"
"os"
"sort"
)
func main() {
reader := bufio.NewReader(os.Stdin)
writer := bufio.NewWriter(os.Stdout)
defer writer.Flush()
var n int
fmt.Fscanln(reader, &n)
var numbers = map[int]bool{}
for i := 0; i < n; i++ {
var key int
fmt.Fscanf(reader, "%d ", &key)
numbers[key] = true
}
keys := []int{}
for key, _ := range numbers {
keys = append(keys, key)
}
sort.Ints(keys)
for _, key := range keys {
fmt.Fprintf(writer, "%d ", key)
}
fmt.Fprintln(writer, "")
}
๐จ Python3
# https://www.acmicpc.net/problem/10867
import sys
if __name__ == "__main__":
n = int(sys.stdin.readline())
numbers = set(map(int, sys.stdin.readline().split()))
for i in sorted(numbers):
print(i, end=" ")
print()
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 4963๋ฒ / ์ฌ์ ๊ฐ์ [Go][Python3] (0) | 2020.12.12 |
---|---|
BOJ / 2644๋ฒ / ์ด์๊ณ์ฐ [Go][Python3] (0) | 2020.12.10 |
BOJ / 1934๋ฒ / ์ต์๊ณต๋ฐฐ์ [Go][Python3] (0) | 2020.12.08 |
BOJ / 7785๋ฒ / ํ์ฌ์ ์๋ ์ฌ๋ [Go][Python3] (0) | 2020.12.07 |
BOJ / 2606๋ฒ / ๋ฐ์ด๋ฌ์ค [Go][Python3] (0) | 2020.12.06 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- ํ
- BFS
- dfs
- ์๋ฐ
- java
- Algorithm
- ๋งฅ๋ถํ๋ก
- AWS
- python3
- ๋ฐ๋
- BOJ
- ์คํ
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- ๋ชฝ๊ณ ๋๋น
- ์๊ณ ๋ฆฌ์ฆ
- ballet
- ์๊ฐ๊ต์ฒด
- ํด์๋งต
- dp
- ๋งฅ๋ถ
- Golang
- go
- Macbook pro 2012 mid 13
- MongoDB
- ๋ฐฑ์ค
- ๋ถํ ์ ๋ณต
- ์ด๋ถํ์
- baekjoon
- ๋ธ๋ฃจํธํฌ์ค
- ํ๋ก์ด๋์์ฌ
- Total
- Today
- Yesterday