제출 #631182

#제출 시각아이디문제언어결과실행 시간메모리
631182smartmonkyRack (eJOI19_rack)C++14
40 / 100
8 ms8604 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back using namespace std; map <int,int> mp; main(){ int n,k; cin >>n >>k; int x=(1 << n); vector <int> v(x+1); vector <int> ans; v[1]=1; ans.pb(1); v[2]=x/2+1; ans.pb(v[2]); int cnt=2; for(int i=x/4;i>=1;i/=2){ for(int j=1;j<=cnt;j++){ // cout<<cnt+j <<" "; v[cnt+j]=v[j]+i; ans.pb(v[j]+i); } cnt*=2; } //for(int i=1;i<=x;i++) // cout<<v[i] <<" "; cout<<ans[k-1]; }

컴파일 시 표준 에러 (stderr) 메시지

rack.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...