結果
| 問題 |
No.851 テストケース
|
| コンテスト | |
| ユーザー |
kat0rik
|
| 提出日時 | 2020-01-10 13:41:06 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 3,153 ms |
| コード長 | 644 bytes |
| コンパイル時間 | 15,242 ms |
| コンパイル使用メモリ | 237,336 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-23 21:56:06 |
| 合計ジャッジ時間 | 11,363 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
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