結果

問題 No.164 ちっちゃくないよ!!
ユーザー graygray
提出日時 2015-03-29 00:40:25
言語 Go
(1.22.1)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 645 bytes
コンパイル時間 12,049 ms
コンパイル使用メモリ 225,780 KB
実行使用メモリ 5,632 KB
最終ジャッジ日時 2024-04-21 15:23:34
合計ジャッジ時間 12,668 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,248 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 12 ms
5,632 KB
testcase_06 AC 10 ms
5,376 KB
testcase_07 AC 5 ms
5,376 KB
testcase_08 AC 9 ms
5,376 KB
testcase_09 AC 9 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func readline() string {
	sc.Scan()
	return sc.Text()
}

func find_min(s string) int64 {
	var min int64 = math.MaxInt64
	for i:=2; i<=36; i++ {
		v,e:=strconv.ParseInt(s, i, 64)
		if e == nil && v < min {
			min = v
		}
	}
	return min
}

func main() {
	// input
	num,_ := strconv.Atoi(readline())
	var datum = make([]string, num)
	for i:=0; i<num; i++ {
		datum = append(datum, readline())
	}

	// proc
	var min int64 = math.MaxInt64
	for _,s := range datum {
		if v:=find_min(s); v < min {
			min = v
		}
	}

	// output
	fmt.Println(min)
}
0