108962024-04-18 12:10:36Leventusz09Akasztós tartócpp17Time limit exceeded 40/1001.065s3028 KiB
#include <bits/stdc++.h>

using namespace std;

int main(){
    int n, k;
    cin >> n >> k;
    vector<bool> lvl(n);

    for(int i=0; i<k; i++){
        for(int j=0; j<n; j++){
            if(i%int(pow(2, j)) == 0) lvl[j] = !lvl[j];
        }
    }
    int o1 = 1;
    for(int i=0; i<n; i++) o1 += !lvl[i] * pow(2, n-i-1);
    cout << o1;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask120/20
1Accepted3ms1812 KiB
2Accepted3ms2084 KiB
3Accepted3ms2212 KiB
4Accepted3ms2300 KiB
5Accepted3ms2368 KiB
subtask220/20
1Accepted3ms2580 KiB
2Accepted4ms2720 KiB
3Accepted37ms2804 KiB
4Accepted114ms2804 KiB
5Accepted165ms2800 KiB
subtask30/60
1Time limit exceeded1.049s2896 KiB
2Time limit exceeded1.057s3028 KiB
3Time limit exceeded1.065s3028 KiB
4Time limit exceeded1.044s2260 KiB
5Time limit exceeded1.065s2400 KiB