Computer Game

https://codeforces.com/contest/1183/problem/C

题解:二分

/*
*@Author:   STZG
*@Language: C++
*/
#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define DEBUG
#define RI register int
#define endl "\n"
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,p,l,r,u,v;
int ans,cnt,flag,temp,sum;
int a,b;
char str;
struct node{};
bool sloved(int mid){
    return (ll)mid*a+(ll)(n-mid)*b>1;
            if(sloved(mid)){
                ans=mid;
                l=mid+1;
            }else{
                r=mid-1;
            }
        }
        cout<

 

你可能感兴趣的:(#,C++)