結果

問題 No.647 明太子
ユーザー nebukuro09nebukuro09
提出日時 2018-02-09 22:25:04
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 797 bytes
コンパイル時間 963 ms
コンパイル使用メモリ 107,360 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-03 18:38:20
合計ジャッジ時間 4,976 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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 = N.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 {
        int ans = 0;
        foreach (i; 0..M) ans += cnt[i] == m;
        ans.writeln;
    }
}
0