結果
| 問題 | No.610 区間賞(Section Award) | 
| コンテスト | |
| ユーザー |  ikd | 
| 提出日時 | 2017-12-11 00:28:14 | 
| 言語 | D (dmd 2.109.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 638 bytes | 
| コンパイル時間 | 1,698 ms | 
| コンパイル使用メモリ | 146,820 KB | 
| 実行使用メモリ | 7,528 KB | 
| 最終ジャッジ日時 | 2024-06-12 22:58:01 | 
| 合計ジャッジ時間 | 4,060 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 43 WA * 7 | 
ソースコード
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[]);
  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);
  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;
}
            
            
            
        