結果

問題 No.164 ちっちゃくないよ!!
ユーザー graygray
提出日時 2015-03-29 00:40:25
言語 Go
(1.22.1)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 645 bytes
コンパイル時間 13,118 ms
コンパイル使用メモリ 207,764 KB
実行使用メモリ 7,884 KB
最終ジャッジ日時 2023-08-03 17:09:02
合計ジャッジ時間 12,960 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 11 ms
7,884 KB
testcase_06 AC 9 ms
7,696 KB
testcase_07 AC 5 ms
5,568 KB
testcase_08 AC 8 ms
5,628 KB
testcase_09 AC 8 ms
5,624 KB
testcase_10 AC 2 ms
4,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