hewo @ 2018-02-18 16:53:59
程序如下,最后四个点错的
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int ts[1005],sc[1005];
struct dz{
int cd;
int xq;
};
dz a[1005];
int main()
{
int n,q;
int m[8]={0,10,100,1000,10000,1000000,1000000,10000000};
cin>>n>>q;
for(int i=1;i<=n;i++) cin>>ts[i];
for(int i=1;i<=q;i++) cin>>a[i].cd>>a[i].xq;
sort(ts+1,ts+n+1);
for(int i=1;i<=q;i++)
{
for(int j=1;j<=n;j++)
{
if(ts[j]%m[a[i].cd]==a[i].xq)
{
cout<<ts[j]<<endl;
break;
}
if(j==n) cout<<-1<<endl;
}
}
return 0;
}
by AThousandSuns @ 2018-02-18 17:12:40
你的m[5]打错了
by hewo @ 2018-02-18 17:22:47
@nantf
???
可以讲细些吗,谢谢
by AThousandSuns @ 2018-02-18 17:24:45
@达拉崩吧_ 100000打成了1000000(逃