結果
問題 |
No.81 すべて足すだけの簡単なお仕事です。
|
ユーザー |
|
提出日時 | 2016-02-25 01:20:56 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 437 bytes |
コンパイル時間 | 12,085 ms |
コンパイル使用メモリ | 223,916 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 16:31:20 |
合計ジャッジ時間 | 12,924 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
package main import ( "bufio" "fmt" "math/big" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func main() { sc.Split(bufio.ScanWords) n := nextInt() t := big.NewRat(0, 1) for i := 0; i < n; i++ { r := new(big.Rat) fmt.Sscan(nextLine(), r) t.Add(t, r) } fmt.Println(t.FloatString(10)) } func nextLine() string { sc.Scan() return sc.Text() } func nextInt() int { i, _ := strconv.Atoi(nextLine()) return i }