liuxu @ 2017-11-21 20:55:53
大佬救命,洛谷官方数据都过了怎么10分
by VenusM1nT @ 2017-11-21 21:42:29
可能是精度
by Caro23333 @ 2017-11-21 21:57:21
官方数据欸
再提交几次试验一下,如果真的差距太大可能确实有问题
可以看看能不能申诉
by liuxu @ 2017-11-21 21:59:35
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
using namespace std;
int n,q,book[1010],l,num;
int main(){
// freopen("librarian.in","r",stdin);
// freopen("librarian.out","w",stdout);
scanf("%d %d",&n,&q);
for(int i=1;i<=n;i++) scanf("%d",&book[i]);
// for(int i=1;i<=n;i++) cout<<book[i]<<' ';
for(int i=1;i<=q;i++){
scanf("%d %d",&l,&num);
int t=1;
for(int j=1;j<=l;j++) t*=10;
// cout<<i<<' '<<t<<endl;
int ans=19990000,flag=0;
for(int j=1;j<=n;j++){
if(book[j]%t==num) if(ans>book[j]){ans=book[j];flag=1;}
}
if(flag) printf("%d\n",ans);
else printf("-1\n");
}
return 0;
}
by liuxu @ 2017-11-21 21:59:52
代码求大神看一看
by Siyuan @ 2017-11-21 22:42:22
你可以申诉呀~~~
by hz4zzhangyue @ 2017-11-22 00:01:03