結果
問題 | No.2999 Long Long Friedrice |
ユーザー |
![]() |
提出日時 | 2025-03-16 12:59:08 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 18 ms / 2,000 ms |
コード長 | 470 bytes |
コンパイル時間 | 13,714 ms |
コンパイル使用メモリ | 258,436 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-16 12:59:24 |
合計ジャッジ時間 | 14,793 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 33 |
ソースコード
package mainimport . "fmt"import . "sort"func main() {var n intScan(&n)ab := make([][]int, n)for i := range ab {ab[i] = make([]int, 2)Scan(&ab[i][0])}for i := range ab {Scan(&ab[i][1])}Slice(ab, func(i, j int) bool {return ab[i][0] < ab[j][0]})r := make([]bool, 5e5*2+1)r[1] = trueans := 1for _, vs := range ab {if !r[vs[0]] {continue}h := vs[0]+vs[1]r[h] = trueif h > ans {ans = h}}Println(ans)}