标签:没有 time isp 之间 测试数据 要求 注意 end nbsp
1 32 2
4
#include <iostream> using namespace std; int main(){ int m; cin>>m; int n,k; while (m--) { cin>>n>>k; int d = 10; for (int i = 1; i < k; i++) { d*=10; } long long b = n%d; long long temp = b; int z; int ans = -1; for (z = 0 ; z < d ;z++) { temp = temp*n%d; if (b==temp) { ans = z+1; break; } } cout<<ans<<endl; } return 0; }
标签:没有 time isp 之间 测试数据 要求 注意 end nbsp
原文地址:https://www.cnblogs.com/lyc94620/p/9696499.html