結果

問題 No.206 数の積集合を求めるクエリ
ユーザー te-shte-sh
提出日時 2016-09-16 10:08:16
言語 D
(dmd 2.106.1)
結果
RE  
実行時間 -
コード長 622 bytes
コンパイル時間 1,044 ms
コンパイル使用メモリ 116,776 KB
実行使用メモリ 14,796 KB
最終ジャッジ日時 2023-09-02 22:11:48
合計ジャッジ時間 11,733 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,368 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 1 ms
4,368 KB
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 1 ms
4,368 KB
testcase_05 AC 1 ms
4,368 KB
testcase_06 AC 2 ms
4,372 KB
testcase_07 AC 2 ms
4,372 KB
testcase_08 AC 3 ms
4,372 KB
testcase_09 AC 2 ms
4,368 KB
testcase_10 AC 1 ms
4,368 KB
testcase_11 RE -
testcase_12 AC 17 ms
4,368 KB
testcase_13 AC 14 ms
4,372 KB
testcase_14 RE -
testcase_15 AC 2 ms
4,368 KB
testcase_16 AC 11 ms
4,372 KB
testcase_17 AC 49 ms
10,164 KB
testcase_18 AC 25 ms
6,264 KB
testcase_19 AC 45 ms
10,316 KB
testcase_20 AC 35 ms
5,700 KB
testcase_21 AC 33 ms
6,600 KB
testcase_22 AC 28 ms
6,536 KB
testcase_23 AC 45 ms
10,112 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

void main()
{
  auto rd = readln.split.map!(to!size_t);
  auto l = rd[0], m = rd[1], n = rd[2];
  auto ai = readln.split.map!(to!int).array;
  auto bi = readln.split.map!(to!int).array;
  auto q = readln.chomp.to!int;

  ai.sort();

  auto buf = new bool[](n + 1);
  foreach (b; bi) buf[b] = true;

  foreach (i; 0..q) {
    writeln(ai.count!(a => buf[a]));
    ai[] -= 1;
    if (ai.front == 0) ai = ai[1..$];
  }
}
0