Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
33365 杨耀然 【J】T3小清新签到题 C++ 解答错误 20 1000 MS 252 KB 408 2024-10-07 18:48:11

Tests(1/5):


#include<bits/stdc++.h> #define ll long long using namespace std; ll f(ll n,ll m,ll x) { return x/n+x/m-x/(n*m)*2; } int main() { int q; cin>>q; while(q--) { ll n,m,k; cin>>n>>m>>k; ll l=1,r=1e18,ret; while(l<=r) { ll mid=(l+r)/2; if(f(n,m,mid)<k) { l=mid+1; } else { ret=mid; r=mid-1; } } cout<<ret<<'\n'; } return 0; }


测评信息: