結果

問題 No.851 テストケース
ユーザー kokatsu
提出日時 2022-02-03 20:36:39
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 3,153 ms
コード長 537 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 215,028 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-22 14:13:09
合計ジャッジ時間 3,208 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N;
    readf("%d\n", N);

    auto A = new long[](N);
    foreach (i; 0 .. N) {
        auto input = readln.chomp.split.to!(long[]);

        if (input.length == 1) {
            A[i] = input[0];
        }
        else {
            writeln("\"assert\"");
            return;
        }
    }

    long[long] list;
    foreach (i; 0 .. N-1) {
        foreach (j; i+1 .. N) {
            ++list[A[i]+A[j]];
        }
    }

    auto nums = list.byKey.array;
    nums.sort!"a > b";

    nums[1].writeln;
}
0