Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
33641 刘西贤 【J】T3小清新签到题 C++ 运行超时 40 1000 MS 252 KB 708 2024-10-16 18:58:18

Tests(2/5):


#include<iostream> #include<bits/stdc++.h> using namespace std; int main() { int f; cin>>f; for(int i=1; i<=f; i++) { long long n,m,k,ans=0,cnt=0; cin>>n>>m>>k; if(m%n==0) { for(int i=n;i<=2100000000;i+=n){ if(i%n==0&&i%m==0){ }else{ cnt++; } if(cnt==k){ cout<<i<<endl; break; } } }else{ if(k==1) { if(n>m) { cout<<m<<endl; } else { cout<<n<<endl; } } else { while(1) { cnt++; if(cnt%n==0||cnt%m==0) { if(cnt%n==0&&cnt%m==0) { } else { ans++; } } if(ans==k) { cout<<cnt<<endl; break; } } } } } return 0; }


测评信息: