제출 #976781

#제출 시각아이디문제언어결과실행 시간메모리
976781AIF_is_carving이상한 기계 (APIO19_strange_device)C++17
5 / 100
1 ms500 KiB
#include<bits/stdc++.h> typedef long long ll; using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); ll n, A, B; cin>>n>>A>>B; ll x, y; cin>>x>>y; ll X = A/(gcd(B+1, A)); //cout<<X<<"\n"; ll t; //cout<<t<<"\n"; int powX=0, powB=0; ll xxx = X; while(xxx>0){ xxx/=2; powX+=1; } xxx=B; while(xxx>0){ xxx/=2; powB+=1; } if(powB+powX>61) t=2e18; else t = B*X; //cout<<t<<"\n"; cout<<min<ll>(y-x+1, t)<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...