Submission #637489

# Submission time Handle Problem Language Result Execution time Memory
637489 2022-09-02T08:13:07 Z ksu2009en Rack (eJOI19_rack) C++17
40 / 100
157 ms 102400 KB
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <cmath>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <bitset>
#include <cstring>

using namespace std;
typedef long long ll;


int main(){
    ll n, k;
    cin >> n >> k;
    
    vector<ll>a = {1, 2};
    
    for(int i = 1; i < n; i++){
        vector<ll>b;
        
        ll add = (1 << i);
        
        for(auto j: a){
            b.push_back(j);
            b.push_back(j + add);
        }
        
        a = b;
    }
    /*
    for(auto i: a)
        cout << i << ' ';
    cout << endl;
     */
    
    cout << a[k - 1] << endl;
     
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 2 ms 1644 KB Output is correct
9 Correct 5 ms 5552 KB Output is correct
10 Correct 19 ms 20936 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 2 ms 1644 KB Output is correct
9 Correct 5 ms 5552 KB Output is correct
10 Correct 19 ms 20936 KB Output is correct
11 Runtime error 157 ms 102400 KB Execution killed with signal 9
12 Halted 0 ms 0 KB -