結果
| 問題 |
No.851 テストケース
|
| コンテスト | |
| ユーザー |
kat0rik
|
| 提出日時 | 2020-01-10 13:39:48 |
| 言語 | Go (1.23.4) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 640 bytes |
| コンパイル時間 | 16,857 ms |
| コンパイル使用メモリ | 229,768 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-23 21:55:47 |
| 合計ジャッジ時間 | 11,956 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 18 WA * 2 |
ソースコード
package main
import (
"bufio"
"fmt"
"os"
"sort"
"strconv"
"strings"
)
func nextLine(sc *bufio.Scanner) string {
sc.Scan()
return sc.Text()
}
func main() {
var N int
fmt.Scan(&N)
sc := bufio.NewScanner(os.Stdin)
a := make([]int, 0)
for i := 0; i < N; i++ {
ss := strings.Split(nextLine(sc), " ")
if len(ss) != 1 {
fmt.Println("assert")
return
}
v, _ := strconv.Atoi(ss[0])
a = append(a, v)
}
b := make([]int, 0)
b = append(b, a[0]+a[1])
b = append(b, a[0]+a[2])
b = append(b, a[1]+a[2])
sort.Sort(sort.Reverse(sort.IntSlice(b)))
if b[0] == b[1] {
fmt.Println(b[2])
} else {
fmt.Println(b[1])
}
}
kat0rik