求助! wr一个!为什么???

P1434 [SHOI2002] 滑雪

—o— @ 2019-07-08 15:13:40

include<iostream>

include<cmath>

include<cstdio>

include<cstdlib>

include<cstring>

include<algorithm>

include<ctime>

include<string>

include<queue>

using namespace std; int N,M; struct on{ int a,b,c; }b[100000000],c[100000]; bool cmp1(on x,on y){

return x.a<=y.a;

} bool cmp2(on x,on y){

return x.b<y.b;

} int main() { cin>>N>>M; int x; for(int i=0;i<N;i++){ cin>>b[i].a; b[i].b=i+1; } for(int i=N;i<N+M;i++) { cin>>b[i].a; b[i].b=0; } sort(b+0,b+N+M+1,cmp1); int t=0; for(int i=0;i<N+M-1;i++){ if(b[i].a==b[i+1].a) { c[t].a=b[i].a; c[t].b=b[i].b+b[i+1].b; t++; } } sort(c+0,c+t,cmp2); for(int i=0;i<t;i++){ cout<<c[i].a<<" ";

} return 0; }


by hater @ 2019-07-08 15:17:02

希望更丰富的展现?使用Markdown


by NaCly_Fish @ 2019-07-08 15:36:58

为什么会变成这样呢?


by cccyf57_【企鹅】 @ 2019-07-08 15:48:16

希望更丰富的展现?使用Markdown


by pengkun @ 2019-07-08 15:50:37

希望更丰富的展现?使用Markdown


by 樱花飞舞 @ 2019-07-08 15:51:38

没有markdown,就是A+B proble我都不想看


|