kobe_blaent @ 2024-07-16 15:06:43
#include<bits/stdc++.h>
using namespace std;
int m[10]={1,10,100,1000,10000,100000,1000000,10000000};
int n,q;
int b[10005];
int main(){
scanf("%d%d",&n,&q);
for(int i=0;i<n;i++){
scanf("%d",&b[i]);
}
sort(b,b+n);
for(int i=0;i<q;i++){
int l,x;
scanf("%d%d",&l,&x);
int a=-1;
for(int j=0;j<x;j++){
int g=b[j]%m[l];
if(g==x){
a=b[j];
break;
}
}
cout<<a<<endl;
}
return 0;
}
by ZhangQirui1 @ 2024-07-29 14:23:47
不是,第十六行j<x是(不懂就问) 不是一共有n本书吗???
by ZhangQirui1 @ 2024-07-29 14:24:55
我测过了就是这里
by ZhangQirui1 @ 2024-07-29 15:15:26
有圆人祝你AK
by kobe_blaent @ 2024-10-05 08:22:55
谢谢你好心人