求第三个点的数据!!!

P1160 队列安排

#还有,我的代码会re,求大佬解释 ```cpp #include<bits/stdc++.h> using namespace std; int n; list <int> member; void print(); int main() { cin >> n; member.push_front(1); for(int i = 2;i <= n;i++) { int x1,y1; cin >> x1 >> y1; list <int> ::iterator j = member.begin(); if(y1 == 0) { for(;*j != x1; ++j){} member.insert(j,i); } if(y1 == 1) { for(;*j != x1;++j){} j++; member.insert(j,i); } } cin >> n; for(int i = 1;i <= n;i++) { int x1; cin >> x1; list <int> ::iterator j = member.begin(); for(;*j != x1 && j != member.end();j++) {} if(j == member.end()) {continue;} member.erase(j); } print(); return 0; } void print() { for(list <int> ::iterator jj = member.begin();jj != member.end();jj++) { cout << *jj << " "; } cout << endl; } ```
by HygoK67 @ 2017-12-11 16:24:07


@[战术目镜](/space/show?uid=67178) 曾经同病相怜,别用list了 查找数据用时太长,亲测,可以出正确答案,但要几十秒......RE有时你可以理解为TLE
by 学无止境 @ 2018-02-07 22:08:26


@[战术目镜](/space/show?uid=67178) 第三个点你自己下载啊,n=100000,我就不发了
by 学无止境 @ 2018-02-07 22:09:07


|