Submission #775337

# Submission time Handle Problem Language Result Execution time Memory
775337 2023-07-06T09:49:35 Z vjudge1 Rack (eJOI19_rack) C++17
40 / 100
1 ms 244 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
vector <bool> v;

int32_t main(){
    faster
    int n,m;cin>>n>>m;
    m--;
    while(m>0){
        v.push_back(m%2);
        m/=2;
    }
    while(v.size()!=n){
        v.push_back(0);
    }
    reverse(v.begin(),v.end());
    int cev=0;
    for(int i=0;i<n;i++){
        if(v[i])cev+=1<<i;
    }
    cout<<cev+1<<'\n';
    return 0;
}

Compilation message

rack.cpp: In function 'int32_t main()':
rack.cpp:15:19: warning: comparison of integer expressions of different signedness: 'std::vector<bool>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   15 |     while(v.size()!=n){
      |           ~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 0 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 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 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 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 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 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Incorrect 1 ms 244 KB Output isn't correct
12 Halted 0 ms 0 KB -