标签:bre highlight pre main ace class pow names div
daima
#include <bits/stdc++.h> using namespace std; int n,q,a[1005]; int main() { cin>>n>>q; for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=q;i++) { int x,y,ans=-1; scanf("%d%d",&x,&y); int z=pow(10,x); for(int j=1;j<=n;j++) { if(a[j]%z==y) { ans=a[j]; break; } } printf("%d",ans); } return 0; }
标签:bre highlight pre main ace class pow names div
原文地址:https://www.cnblogs.com/zxjhaha/p/11836976.html