結果

問題 No.2775 Nuisance Balls
ユーザー nafell
提出日時 2024-06-09 21:18:35
言語 Go
(1.23.4)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 9,715 ms
コンパイル使用メモリ 235,560 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-31 00:04:50
合計ジャッジ時間 10,669 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

// You can edit this code!
// Click here and start typing.
package main

import "fmt"
import "strconv"

func main() {
	nums := [6]int {720, 360, 180, 30, 6, 1}

	m := make(map[int]string)
	m[720] = "C"
	m[360] = "M"
	m[180] = "S"
	m[30] = "R"
	m[6] = "o"
	m[1] = "."

	var Nstr string
   	fmt.Scan(&Nstr)
	N, _ := strconv.Atoi(Nstr)
	
	result := ""
	cursor := 0
	for N > 0 {
		if N < nums[cursor] {
			cursor++
			continue
		}
		
		N -= nums[cursor]
		result += m[nums[cursor]]
	}
	
	fmt.Println(result)
}
0