ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป ๋ฌธ์ œ

 

9655๋ฒˆ: ๋Œ ๊ฒŒ์ž„

์ƒ๊ทผ์ด๊ฐ€ ๊ฒŒ์ž„์„ ์ด๊ธฐ๋ฉด SK๋ฅผ, ์ฐฝ์˜์ด๊ฐ€ ๊ฒŒ์ž„์„ ์ด๊ธฐ๋ฉด CY์„ ์ถœ๋ ฅํ•œ๋‹ค.

www.acmicpc.net


โœ๐Ÿป ํ’€์ด

๐ŸŽจ Go

// https://www.acmicpc.net/problem/9655
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n int
	fmt.Fscanln(reader, &n)
	fmt.Fprintln(writer, getWinner(n))
}

func getWinner(n int) string {
	if n%2 == 0 {
		return "CY"
	}
	return "SK"
}

๐ŸŽจ Python3

# https://www.acmicpc.net/problem/9655
import sys

def get_winner(n):
    if n%2 == 0:
        return "CY"
    return "SK"

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    print(get_winner(n))
728x90
๋Œ“๊ธ€