結果

問題 No.647 明太子
ユーザー nebukuro09nebukuro09
提出日時 2018-02-09 22:27:51
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 53 ms / 4,500 ms
コード長 767 bytes
コンパイル時間 673 ms
コンパイル使用メモリ 109,092 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-03 18:38:22
合計ジャッジ時間 1,955 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 4 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 3 ms
4,376 KB
testcase_13 AC 5 ms
4,376 KB
testcase_14 AC 40 ms
4,380 KB
testcase_15 AC 7 ms
4,380 KB
testcase_16 AC 3 ms
4,384 KB
testcase_17 AC 50 ms
4,376 KB
testcase_18 AC 53 ms
4,380 KB
testcase_19 AC 11 ms
4,380 KB
testcase_20 AC 11 ms
4,380 KB
testcase_21 AC 5 ms
4,380 KB
testcase_22 AC 34 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

immutable long MOD = 10^^9 + 7;


void main() {
    auto N = readln.chomp.to!int;
    auto AB = N.iota.map!(_ => readln.split.map!(to!int).array).array;
    auto M = readln.chomp.to!int;
    auto XY = M.iota.map!(_ => readln.split.map!(to!int).array).array;
    auto cnt = new int[](M);

    foreach (i; 0..N)
        foreach (j; 0..M)
            if (XY[j][0] <= AB[i][0] && XY[j][1] >= AB[i][1])
                cnt[j] += 1;

    auto m = cnt.reduce!max;
    if (m == 0) {
        0.writeln;
    } else {
        foreach (i; 0..M) if (cnt[i] == m) (i+1).writeln;
    }
}
0