답안 #530560

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
530560 2022-02-25T20:23:00 Z Monkey Rack (eJOI19_rack) C++14
0 / 100
0 ms 204 KB
#include <bits/stdc++.h>
using namespace std;

const int MAXN=1e6+7;
int wieszaki[MAXN];

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n, akt=0;
	int potega=1, zasieg;
	int ile, ruch=0;
	int i;
	
	cin >> n >> ile;
	for(i=1; i<=n; ++i)
	{
		potega*=2;
	}
	
	zasieg=potega/2;
	++wieszaki[0];
	
	while(ruch<ile)
	{
		zasieg/=2;
		akt=0;
		while(akt<potega && ruch<ile)
		{
			akt+=zasieg;
			if(zasieg==1)
			{
				continue;
			}
			++wieszaki[akt];
			++ruch;
		}
	}
	++akt;
	cout << akt;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -