Submission #236881

#TimeUsernameProblemLanguageResultExecution timeMemory
236881EJOI2019AndrewRack (eJOI19_rack)C++14
0 / 100
4 ms384 KiB
#include<bits/stdc++.h> using namespace std; int ans; int rack(int n,int k) { if(k<=1) return ans; if(k%2) { ans*=2; rack(n/2,k/2); } else { ans*=2; ++ans; rack(n/2,k/2); } } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,k; cin>>n>>k; ans=1; cout<<rack(n,k); }

Compilation message (stderr)

rack.cpp: In function 'int rack(int, int)':
rack.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...