結果

問題 No.2775 Nuisance Balls
ユーザー ゆうP
提出日時 2024-06-12 23:38:57
言語 Go
(1.23.4)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 14,619 ms
コンパイル使用メモリ 221,964 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 23:39:14
合計ジャッジ時間 15,767 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.2775 Nuisance Balls
package main

import (
	"fmt"
)

func main() {

	var n int
	fmt.Scan(&n)

	var ans string
	x := n
	for {
		switch {
		case x >= 720:
			ans += "C"
			x -= 720
		case x >= 360:
			ans += "M"
			x -= 360
		case x >= 180:
			ans += "S"
			x -= 180
		case x >= 30:
			ans += "R"
			x -= 30
		case x >= 6:
			ans += "o"
			x -= 6
		case x >= 1:
			ans += "."
			x -= 1
		}
		if x <= 0 {
			break
		}
	}
	fmt.Println(ans)
}
0