답안 #981673

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
981673 2024-05-13T12:39:07 Z Nomio Rack (eJOI19_rack) C++17
40 / 100
50 ms 102400 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n, k;
	cin >> n >> k;
	if(k == 1) {
		cout << 1 << '\n';
		return 0;
	}
	vector<int> v;
	v.push_back(1);
	while(v.size() < k) {
		n--;
		int m = v.size();
		for(int i = 0; i < m; i++) {
			int x = v[i] + (1 << n);
			v.push_back(x);
		}
	}
	cout << v[k - 1] << '\n';
	return 0;
}

Compilation message

rack.cpp: In function 'int main()':
rack.cpp:12:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   12 |  while(v.size() < k) {
      |        ~~~~~~~~~^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 432 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 432 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 728 KB Output is correct
9 Correct 1 ms 1492 KB Output is correct
10 Correct 2 ms 1492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 432 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 728 KB Output is correct
9 Correct 1 ms 1492 KB Output is correct
10 Correct 2 ms 1492 KB Output is correct
11 Runtime error 50 ms 102400 KB Execution killed with signal 9
12 Halted 0 ms 0 KB -