Submission #809115

# Submission time Handle Problem Language Result Execution time Memory
809115 2023-08-05T17:35:55 Z ThylOne Rack (eJOI19_rack) C++14
40 / 100
1 ms 300 KB
#include<bits/stdc++.h>

using namespace std;
const int MOD = 1000000007;
signed main(){
	int n,k;cin>>n>>k;
	long long inf = 1;
	long long sup = (1<<n);
	k--;
	for(int i=0;i<min(n,60);i++){
		int mid = (sup+inf)/2;
		
		if((k>>i)&1){
			//right
			inf = mid+1;
		}else{
			//left
			sup=mid;
		}
		
	}
	cout<<inf%MOD<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 296 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 296 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 300 KB Output is correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -