Submission #1099539

# Submission time Handle Problem Language Result Execution time Memory
1099539 2024-10-11T14:33:19 Z vjudge1 Rack (eJOI19_rack) C++17
40 / 100
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

string abc = "abcdefghijklmnopqrstuvwxyz";

#define int long long



signed  main(){
    int n, k;
    cin >> n >> k;

    int ans = 0;

    int cnt = 1; 
    int aux = 1; 
    int sum = 1;
    for(int i = 0; i < n-1; i++) sum*=2;  
    for(int i = 0; i < n; i++){
        if((k-1)&aux){
            ans+=sum;
        }
        sum/=2;
        aux*=2;
    }

    cout << ans+1 << endl;
}

Compilation message

rack.cpp: In function 'int main()':
rack.cpp:16:9: warning: unused variable 'cnt' [-Wunused-variable]
   16 |     int cnt = 1;
      |         ^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Incorrect 1 ms 348 KB Output isn't correct
12 Halted 0 ms 0 KB -