RT.谷外题目完全一致,就是达不到的结点距离输出-1
蒟蒻die码:
#include <bits/stdc++.h>
using namespace std;
template <typename T>inline void R(T& t){
t=0; register char ch=getchar();
while(!('0'<=ch&&ch<='9')){ if(ch=='-') t*=-1; ch=getchar(); }
while(('0'<=ch&&ch<='9')){ t=((t<<1)+(t<<3))+ch-'0'; ch=getchar(); }
}
template <typename T,typename... Args> inline void R(T& t, Args&... args){R(t);R(args...);}
template <typename T>inline void W(T x){
if(x<0) putchar('-'),x=~(x-1); int s[30],top=0; while(x) s[++top]=x%10,x/=10;
if(!top) s[++top]=0; while(top) putchar(s[top--]+'0');
}
vector<int>a;
int main(){
freopen("1.out","r",stdin);
a.resize(2000000);
for(int i=1;i<=100000;++i) cin>>a[i];
for(int i=1;i<=100000;++i){
int x;cin>>x;
if(x!=a[i]){
cout<<i<<' '<<x<<' '<<a[i]<<endl;
}
}
return 0;
}
谷外数据:https://www.luogu.com.cn/problem/U158717
经蒟蒻文本比较后,发现是下面几个结点的问题:
哪个结点 标准答案 蒟蒻答案
1146 1054996 1228201
2974 982161 1189771
7171 1132602 1144085
10430 1139144 1144115
13352 1019061 1033141
15918 1036318 1047801
31610 1012242 1026322
33319 1038910 -1
43660 1161037 1166008
44078 1006610 1064754
47441 1056853 1068580
49490 982407 996487
53054 1001970 1016050
63937 1043665 1055148
68805 1132066 1146146
70561 1113828 1118799
79181 1051191 -1
79361 1091220 1105300
86138 1006645 1113874
89262 1041529 -1
90746 1019731 1031214
93652 1011771 1025789
94089 1072164 1083647
95282 1033987 1048005
95478 1015328 1029408
调了很久了,求大佬帮忙。