結果
問題 |
No.610 区間賞(Section Award)
|
ユーザー |
|
提出日時 | 2020-03-04 10:34:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 368 bytes |
コンパイル時間 | 724 ms |
コンパイル使用メモリ | 74,752 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 23:33:54 |
合計ジャッジ時間 | 4,056 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 WA * 5 |
コンパイルメッセージ
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=0; 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; }