結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー luvsicluvsic
提出日時 2018-05-03 10:40:34
言語 Go
(1.22.1)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 12,536 ms
コンパイル使用メモリ 207,372 KB
実行使用メモリ 8,416 KB
最終ジャッジ日時 2023-09-10 09:16:50
合計ジャッジ時間 14,443 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 6 ms
4,380 KB
testcase_08 AC 24 ms
5,760 KB
testcase_09 AC 33 ms
8,116 KB
testcase_10 AC 86 ms
8,356 KB
testcase_11 AC 87 ms
8,356 KB
testcase_12 AC 88 ms
8,360 KB
testcase_13 AC 91 ms
8,356 KB
testcase_14 AC 94 ms
8,412 KB
testcase_15 AC 96 ms
8,416 KB
testcase_16 AC 107 ms
8,412 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
)

func main() {
	var i, n int64
	sum := new(big.Int)

	fmt.Scan(&n)

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	for i = 0; i < n; i++ {
		sc.Scan()
		s := sc.Text()
		x, _ := new(big.Int).SetString(s, 10)
		sum = sum.Add(sum, x)
	}
	fmt.Println(sum)
}
0