結果
| 問題 | No.2851 Make Pairs |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-02 01:13:14 |
| 言語 | Standard ML (MLton 20241230) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 2,000 ms |
| コード長 | 677 bytes |
| 記録 | |
| コンパイル時間 | 6,150 ms |
| コンパイル使用メモリ | 704,488 KB |
| 実行使用メモリ | 35,108 KB |
| 最終ジャッジ日時 | 2026-06-02 01:13:22 |
| 合計ジャッジ時間 | 5,738 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 |
ソースコード
fun readInt () =
valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)
val () =
let
val n = readInt ()
val a_s = List.tabulate (n, fn _ => readInt ())
val table = Array.array (200001, 0)
fun findAns [] = 0
| findAns (h::tl) =
if Array.sub (table, h) = 1
then
(
Array.update (table, h, 0);
1 + findAns tl
)
else
(
Array.update (table, h, 1);
findAns tl
)
val ans = findAns a_s
in
print (Int.toString ans ^ "\n")
end