結果
問題 | No.395 永遠の17歳 |
ユーザー | 💕💖💞 |
提出日時 | 2016-09-09 13:46:45 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 730 bytes |
コンパイル時間 | 11,415 ms |
コンパイル使用メモリ | 243,724 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-05 02:16:54 |
合計ジャッジ時間 | 10,948 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
package main import ( "bufio" "fmt" "os" "strconv" _ "strings" _ "math" _ "sort" ) func main() { scanner := bufio.NewScanner(os.Stdin) th := 0 tgt := "" for scanner.Scan() { th += 1 text := scanner.Text() if text == "" { break } tgt = text if th == 1 { break } } tgti, _ := strconv.Atoi(tgt) if tgti > 43 { fmt.Println(tgti - 7) os.Exit(0) } all := [][]int{} for i := 2; i < 100; i++ { r, e := strconv.ParseInt("17", i, 32) _ = e _ = r if e == nil { all = append(all, []int{ int(r), i } ) } //fmt.Println(i, " ",r," ", e) } for _, a := range all { if a[0] == tgti { fmt.Println(a[1]) os.Exit(0) } } fmt.Println(-1) //fmt.Println("max ", all[len(all)]) }