結果

問題 No.2851 Make Pairs
ユーザー InTheBloomInTheBloom
提出日時 2024-08-25 13:33:34
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 5,028 ms
コンパイル使用メモリ 175,388 KB
実行使用メモリ 27,184 KB
最終ジャッジ日時 2024-08-25 13:33:48
合計ジャッジ時間 5,496 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 56 ms
21,052 KB
testcase_03 AC 70 ms
23,980 KB
testcase_04 AC 67 ms
22,996 KB
testcase_05 AC 35 ms
11,824 KB
testcase_06 AC 71 ms
27,184 KB
testcase_07 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main () {
    int N = readln.chomp.to!int;
    auto A = readln.split.to!(int[]);

    int[int] mp;
    foreach (v; A) mp[v]++;

    int ans = 0;
    foreach (key, val; mp) ans += val / 2;

    writeln(ans);
}

void read (T...) (string S, ref T args) {
    import std.conv : to;
    import std.array : split;
    auto buf = S.split;
    foreach (i, ref arg; args) {
        arg = buf[i].to!(typeof(arg));
    }
}
0