結果
問題 | No.2110 012 Matching |
ユーザー |
|
提出日時 | 2022-10-28 21:59:50 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 712 bytes |
コンパイル時間 | 14,778 ms |
コンパイル使用メモリ | 229,428 KB |
実行使用メモリ | 7,972 KB |
最終ジャッジ日時 | 2024-07-06 01:07:40 |
合計ジャッジ時間 | 12,969 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
// No.2110 012 Matchingpackage mainimport ("bufio""fmt""os""strconv""strings")func min(a, b int) int {if a <= b {return a} else {return b}}func main() {sc := bufio.NewScanner(os.Stdin)sc.Scan()T, _ := strconv.Atoi(sc.Text())wr := bufio.NewWriter(os.Stdout)defer wr.Flush()for i := 0; i < T; i++ {sc.Scan()ss := strings.Split(sc.Text(), " ")A, _ := strconv.Atoi(ss[0])B, _ := strconv.Atoi(ss[1])C, _ := strconv.Atoi(ss[2])point := 0p02 := min(A, C)point += 2 * p02A -= p02C -= p02p11 := B / 2point += 2 * p11B -= 2 * p11p22 := C / 2point += 1 * p22p01 := min(A, B)point += 1 * p01fmt.Fprintln(wr, point)}}