結果

問題 No.610 区間賞(Section Award)
ユーザー ikdikd
提出日時 2017-12-10 00:24:36
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 631 bytes
コンパイル時間 1,632 ms
コンパイル使用メモリ 145,604 KB
実行使用メモリ 13,700 KB
最終ジャッジ日時 2023-09-03 17:24:51
合計ジャッジ時間 4,272 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 9 ms
5,804 KB
testcase_20 AC 43 ms
12,232 KB
testcase_21 AC 6 ms
5,820 KB
testcase_22 AC 29 ms
10,140 KB
testcase_23 AC 5 ms
4,380 KB
testcase_24 AC 11 ms
5,804 KB
testcase_25 AC 4 ms
4,376 KB
testcase_26 AC 20 ms
9,992 KB
testcase_27 AC 43 ms
12,052 KB
testcase_28 AC 39 ms
11,548 KB
testcase_29 AC 27 ms
10,820 KB
testcase_30 AC 36 ms
11,204 KB
testcase_31 AC 18 ms
10,572 KB
testcase_32 AC 40 ms
11,900 KB
testcase_33 AC 6 ms
5,848 KB
testcase_34 AC 44 ms
11,628 KB
testcase_35 AC 20 ms
9,888 KB
testcase_36 AC 39 ms
11,828 KB
testcase_37 AC 35 ms
10,976 KB
testcase_38 AC 9 ms
5,804 KB
testcase_39 AC 48 ms
12,184 KB
testcase_40 AC 47 ms
12,280 KB
testcase_41 AC 46 ms
12,644 KB
testcase_42 AC 48 ms
12,412 KB
testcase_43 AC 47 ms
13,700 KB
testcase_44 AC 67 ms
13,108 KB
testcase_45 AC 80 ms
11,952 KB
testcase_46 AC 78 ms
12,644 KB
testcase_47 AC 36 ms
12,340 KB
testcase_48 AC 34 ms
11,852 KB
testcase_49 AC 37 ms
12,544 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[]);

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

  sort(c);
  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