Submission #566846

#TimeUsernameProblemLanguageResultExecution timeMemory
566846azberjibiouStar Trek (CEOI20_startrek)C++17
7 / 100
1 ms324 KiB
#include <bits/stdc++.h>
#define gibon ios::sync_with_stdio(false); cin.tie(0);
#define fir first
#define sec second
#define pdd pair<long double, long double>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ld long double
#define pmax pair<__int128, __int128>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
using namespace std;
int dx[4]= {0, 1, 0, -1}, dy[4]= {1, 0, -1, 0};
int ddx[8]={1, 1, 0, -1, -1, -1, 0, 1}, ddy[8]={0, 1, 1, 1, 0, -1, -1, -1};
const int mxN=100025;
const int mxM=300005;
const int mxK=1000000000;
const ll MOD=1'000'000'007;
const ll INF=1000000000000000005;
ll N, D;
ll mypow(ll a, ll b)
{
    if(b==0)    return 1;
    if(b==1)    return a%MOD;
    ll tmp=mypow(a, b/2);
    tmp*=tmp;   tmp%=MOD;
    if(b%2) tmp*=a; tmp%=MOD;
    return tmp;
}
int main()
{
    gibon
    cin >> N >> D;
  	ll ans=1;
  	cout << mypow(4, D);
}

Compilation message (stderr)

startrek.cpp: In function 'll mypow(ll, ll)':
startrek.cpp:29:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   29 |     if(b%2) tmp*=a; tmp%=MOD;
      |     ^~
startrek.cpp:29:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   29 |     if(b%2) tmp*=a; tmp%=MOD;
      |                     ^~~
startrek.cpp: In function 'int main()':
startrek.cpp:36:7: warning: unused variable 'ans' [-Wunused-variable]
   36 |    ll ans=1;
      |       ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...