Submission #651855

#TimeUsernameProblemLanguageResultExecution timeMemory
651855beaconmcSelf Study (JOI22_ho_t2)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define FOR(i, x, y) for(ll i=x; i<y; i++) #define FORNEG(i, x, y) for(ll i=x; i>y; i--) #define fast() ios_base::sync_with_stdio(false);cin.tie(NULL) ll n,m; vector<ll> lis; vector<ll> lis2; bool check(ll a){ ll cnt = 0; FOR(i,0,n){ if (lis[i] > lis2[i]){ if (a>lis[i]*m){ cnt += (a-(lis[i]*m)-1)/lis2[i]+1 + m; }else{ cnt += (a-1)/lis[i]; } }else{ cnt += (a-1)/lis2[i]; } } if (cnt <= n*m){ return true; }return false; } int main(){ ll lo = 0; ll hi = 100000000000000000; while (lo<hi){ ll mid = (lo+hi+1)/2; if (check(mid)){ lo = mid; }else{ hi = mid - 1 } } cout << lo; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:43:16: error: expected ';' before '}' token
   43 |    hi = mid - 1
      |                ^
      |                ;
   44 |   }
      |   ~