Submission #1115939


Source Code Expand

#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
int main(){
ll n,m;
cin>>n>>m;
ll l=0;
llr=n;
ll ans;
while(l<=r){
ll mid=(l+r)/2;
ll rr=m;
rr-=mid*2;
ll e=n+rr/2;
rr-=(rr/2);
if(e>= mid && rr>=0)
l=mid+1,ans=mid;
else
r=mid-1;
}
cout<<ans<<endl;
}

Submission Info

Submission Time
Task C - Scc Puzzle
User the_one1
Language C++14 (GCC 5.4.1)
Score 0
Code Size 289 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:8:1: error: ‘llr’ was not declared in this scope
 llr=n;
 ^
./Main.cpp:10:10: error: ‘r’ was not declared in this scope
 while(l<=r){
          ^