結果
問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
ユーザー |
![]() |
提出日時 | 2022-11-12 23:16:19 |
言語 | Go (1.23.4) |
結果 |
RE
|
実行時間 | - |
コード長 | 341 bytes |
コンパイル時間 | 15,272 ms |
コンパイル使用メモリ | 219,008 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 11:15:44 |
合計ジャッジ時間 | 16,498 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 4 |
other | RE * 15 |
ソースコード
package main import ( "bufio" "fmt" "os" "strconv" "strings" ) func main() { s1 := bufio.NewScanner(os.Stdin) s1.Scan() n, _ := strconv.Atoi(s1.Text()) s2 := bufio.NewScanner(os.Stdin) s2.Scan() v := strings.Fields(s2.Text()) sum := 0 for i := 0; i < n; i++ { l, _ := strconv.Atoi(v[i]) sum += l } fmt.Println(sum) }