其他分享
首页 > 其他分享> > Wannafly Camp 2020 Day 7K 修炼

Wannafly Camp 2020 Day 7K 修炼

作者:互联网

搞了半天才发现TMD是个模拟

#include <bits/stdc++.h>
using namespace std;

#define int long long

int x,y,p,q,ans;
signed main() {
    int n;
    cin>>p>>q>>n;
    ans=1e+9;
    for(int i=1;i<=n;i++) {
        cin>>x>>y;
        int v1=0,v2=0,tmp=0,u=p,v=q;
        while(v1<x || v2<y) {
            v1+=++u;
            v2+=++v;
            ++tmp;
        }
        ans=min(ans,tmp);
    }
    cout<<ans<<endl;
}

标签:int,Camp,7K,long,Wannafly,v1,TMD,ans
来源: https://www.cnblogs.com/mollnn/p/12262143.html