| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 91129 | sh25_shenpy | 图书管理员 | C++ | 通过 | 29 MS | 296 KB | 482 | 2026-06-12 15:07:40 |
#include<iostream> #include<cmath> using namespace std; int n,q,book[6666],len[6666],num[6666]; int main() { cin>>n>>q; for(int i=1; i<=n; i++) cin>>book[i]; for(int i=1; i<=q; i++) { cin>>len[i]>>num[i]; int tmp = pow(10,len[i]),min = 10000001; for(int j=1; j<=n; j++) if(book[j] % tmp == num[i] && book[j] < min) min = book[j]; if(min != 10000001) cout<<min<<endl; else cout<<-1<<endl; } return 0; }