hank0402 @ 2021-05-03 12:13:17
代码:
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
int book[maxn],mod[9]={1,10,100,1000,10000,100000,100000,1000000};
int n,q;
int main(){
cin>>n>>q;
for(int i=1;i<=n;i++)
cin>>book[i];
sort(book+1,book+n+1);
for(int i=1;i<=q;i++){
int now,len,flag=0;
cin>>len>>now;
for(int j=1;j<=n;j++){
if(book[j]%mod[len]==now){
cout<<book[j]<<endl;
flag=1;
break;
}
}
if(flag==0) cout<<-1<<endl;
}
return 0;
}
救救孩子吧!
记录
by Suuuu_Jiang @ 2021-05-05 16:24:45
看不明白
by ASDhyw @ 2021-07-04 08:57:02
第十个点我看数据很大,但不太清楚哪错了
by Tianxn @ 2021-08-23 16:31:03
mod数组两个100000
by hank0402 @ 2021-08-30 13:35:21
谢,已A