結果
問題 | No.610 区間賞(Section Award) |
ユーザー |
|
提出日時 | 2020-03-04 10:46:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 173 ms / 2,000 ms |
コード長 | 369 bytes |
コンパイル時間 | 706 ms |
コンパイル使用メモリ | 74,624 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 23:35:24 |
合計ジャッジ時間 | 3,728 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() | ^~~~
ソースコード
#include<iostream> #include<algorithm> #include<vector> using namespace std; int N; int invA[1<<17]; main() { cin>>N; for(int i=0;i<N;i++) { int A;cin>>A; invA[A]=i; } int m=-1; vector<int>ans; for(int i=0;i<N;i++) { int B;cin>>B; if(m<invA[B]) { m=invA[B]; ans.push_back(B); } } sort(ans.begin(),ans.end()); for(int a:ans)cout<<a<<endl; }