結果

問題 No.2851 Make Pairs
ユーザー InTheBloom
提出日時 2024-08-25 13:33:34
言語 D
(dmd 2.109.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
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

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