Submission #855458

#TimeUsernameProblemLanguageResultExecution timeMemory
855458sofijavelkovskaStar Trek (CEOI20_startrek)C++14
0 / 100
1 ms2652 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN=1e5, MOD=1e9+7; vector<int> adj[MAXN+1]; long long power2(long long n) { long long result=1, current=2; for (long long i=0; i<64; i++) { if (n&((long long)1<<i)) result=result*current%MOD; current=current*current%MOD; } return result; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, x, y, i; long long d; cin >> n >> d; for (i=0; i<n-1; i++) { cin >> x >> y; adj[x].push_back(y); adj[y].push_back(x); } cout << power2(d); return 0; }
#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...