結果

問題 No.851 テストケース
ユーザー むらためむらため
提出日時 2019-09-03 05:04:03
言語 Nim
(2.0.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 472 bytes
コンパイル時間 2,800 ms
コンパイル使用メモリ 67,108 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-15 12:51:44
合計ジャッジ時間 4,079 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(13, 11) Warning: Deprecated since v0.20, use 'initHashSet'; initSet is deprecated [Deprecated]

ソースコード

diff #

import sequtils,sets,algorithm
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" ,discardable.}
proc scan(): int =
  while true:
    let k = getchar_unlocked()
    if k < '0':
      if k == ' ' : quit "\"assert\"",0
      return
    result = 10 * result + k.ord - '0'.ord

let n = scan()
let A = newSeqWith(n,scan())
var ans = initSet[int]()
for i in 0..<n:
  for j in (i+1)..<n:
    ans.incl A[i] + A[j]
echo toSeq(ans.items).sorted(cmp)[^2]
0