Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
33306 | lnx | 最大公约数和最小公倍数问题 | C++ | Accepted | 0 MS | 252 KB | 297 | 2023-12-08 16:41:48 |
#include<iostream> using namespace std; int main() { int x0,y0,x,i=2,k=0; cin>>x0>>y0; if(y0%x0!=0) { cout<<0; return 0; } x=y0/x0; while(x!=1) { while(x%i!=0)i++;k++; while(x%i==0)x/=i; } cout<<k*2; return 0; }