Submission #731758

# Submission time Handle Problem Language Result Execution time Memory
731758 2023-04-27T22:07:06 Z AtabayRajabli Rack (eJOI19_rack) C++11
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define MAX 5e4 + 1
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define INF 0x3F3F3F3F3F3F3F3FLL
#define OPT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define sec second
#define fi first

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

binpow(ll a, ll b, ll c)
{

}

void $()
{
    int n, k, mod = 1e9 + 7;
    cin >> n >> k;
    k--;

    int res = 0;

    while(k)
    {
        n--;
        if(k & 1)
        {
            res = (res + (int)pow(2, n)) % mod;
        }

        k >>= 1;
    }

    cout << res + 1 << endl;
}

int main()
{
    OPT

    int t = 1;
    //cin >> t;

    while(t--)
        $();
}

Compilation message

rack.cpp:17:1: error: ISO C++ forbids declaration of 'binpow' with no type [-fpermissive]
   17 | binpow(ll a, ll b, ll c)
      | ^~~~~~
rack.cpp: In function 'int binpow(ll, ll, ll)':
rack.cpp:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^