結果

問題 No.610 区間賞(Section Award)
ユーザー ikdikd
提出日時 2017-12-11 00:31:23
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 682 bytes
コンパイル時間 1,498 ms
コンパイル使用メモリ 145,868 KB
実行使用メモリ 9,376 KB
最終ジャッジ日時 2023-09-03 17:25:15
合計ジャッジ時間 4,163 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 6 ms
4,380 KB
testcase_20 AC 24 ms
7,320 KB
testcase_21 AC 5 ms
5,236 KB
testcase_22 AC 16 ms
6,708 KB
testcase_23 AC 3 ms
4,376 KB
testcase_24 AC 7 ms
4,384 KB
testcase_25 AC 3 ms
4,380 KB
testcase_26 AC 12 ms
5,708 KB
testcase_27 AC 24 ms
7,404 KB
testcase_28 AC 22 ms
7,200 KB
testcase_29 AC 16 ms
6,344 KB
testcase_30 AC 20 ms
7,344 KB
testcase_31 AC 11 ms
5,212 KB
testcase_32 AC 23 ms
7,380 KB
testcase_33 AC 5 ms
4,376 KB
testcase_34 AC 24 ms
7,460 KB
testcase_35 AC 12 ms
5,436 KB
testcase_36 AC 23 ms
7,408 KB
testcase_37 AC 19 ms
6,924 KB
testcase_38 AC 6 ms
4,380 KB
testcase_39 AC 26 ms
7,516 KB
testcase_40 AC 26 ms
7,380 KB
testcase_41 AC 26 ms
7,428 KB
testcase_42 AC 25 ms
7,396 KB
testcase_43 AC 24 ms
7,396 KB
testcase_44 AC 53 ms
8,040 KB
testcase_45 AC 61 ms
7,332 KB
testcase_46 AC 62 ms
7,388 KB
testcase_47 AC 21 ms
9,376 KB
testcase_48 AC 19 ms
7,124 KB
testcase_49 AC 21 ms
7,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int n; rd(n);
  auto a=readln.split.to!(int[]);
  auto b=readln.split.to!(int[]);

  a.each!"a--"; b.each!"a--";
  auto vis=new bool[](n);
  int i=0; int[] c;
  for(int j=0; j<n; j++){
    if(vis[b[j]]) continue;
    while(i<n && a[i]!=b[j]) vis[a[i]]=true, i++;
    c~=b[j];
  }

  sort(c); c.each!"a++";
  writefln("%(%s\n%)", c);
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}
void wr(T...)(T x){
  import std.stdio;
  foreach(e; x) stderr.write(e, " ");
  stderr.writeln;
}
0