답안 #775342

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
775342 2023-07-06T09:51:55 Z vjudge1 Rack (eJOI19_rack) C++17
컴파일 오류
0 ms 0 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)%mod<<'\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){
      |           ~~~~~~~~^~~
rack.cpp:23:19: error: 'mod' was not declared in this scope; did you mean 'modf'?
   23 |     cout<<(cev+1)%mod<<'\n';
      |                   ^~~
      |                   modf