Submission #1101248

#TimeUsernameProblemLanguageResultExecution timeMemory
1101248fve5Star Trek (CEOI20_startrek)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

constexpr int MOD = 1e9 + 7;

int main() {
  int N; cin >> n;
  long long D; cin >> D;
  
  long long b = 2;
  long long a = 1;
  do {
    if (D & 1) a = a * b % MOD;
    b = b * b % MOD;
  } while (D >>= 1);
  
  cout << a << '\n';
}

Compilation message (stderr)

startrek.cpp: In function 'int main()':
startrek.cpp:7:17: error: 'n' was not declared in this scope
    7 |   int N; cin >> n;
      |                 ^
startrek.cpp:7:7: warning: unused variable 'N' [-Wunused-variable]
    7 |   int N; cin >> n;
      |       ^