답안 #631231

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
631231 2022-08-17T21:11:27 Z smartmonky Rack (eJOI19_rack) C++14
40 / 100
661 ms 98800 KB
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
main(){
	int n,k;
	cin >>n >>k;
	int x=(1 << n);
	map<int,int> v,ans;
	v[1]=1;
	ans[1]=1;
	v[2]=x/2+1;
	ans[2]=(v[2]);
	int cnt=2;
	int s=3;
	for(int i=x/4;i>=1;i/=2){
		for(int j=1;j<=cnt;j++){
			if(cnt+j<=x){
				v[cnt+j]=v[j]+i;
				ans[s]=v[j]+i;
				s++;
			}
		}
		cnt*=2;
	}
	cout<<ans[k];
}

Compilation message

rack.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 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 0 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 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 0 ms 340 KB Output is correct
6 Correct 1 ms 468 KB Output is correct
7 Correct 3 ms 980 KB Output is correct
8 Correct 30 ms 6340 KB Output is correct
9 Correct 143 ms 24908 KB Output is correct
10 Correct 661 ms 98800 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 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 0 ms 340 KB Output is correct
6 Correct 1 ms 468 KB Output is correct
7 Correct 3 ms 980 KB Output is correct
8 Correct 30 ms 6340 KB Output is correct
9 Correct 143 ms 24908 KB Output is correct
10 Correct 661 ms 98800 KB Output is correct
11 Incorrect 1 ms 340 KB Output isn't correct
12 Halted 0 ms 0 KB -