Submission #641632

#TimeUsernameProblemLanguageResultExecution timeMemory
641632ItamarStar Trek (CEOI20_startrek)C++14
7 / 100
3 ms2660 KiB
using namespace std; #include <iostream> #include <vector> #define pi pair<int,int> #define vi vector<int> #define ll long long const int siz = 1e5; vi f[siz]; ll m = 1e9 + 7; ll powe(ll a, ll b) { if (b == 0) return 1; ll ans = powe(a, b / 2); ans = (ans * ans) % m; if (b % 2) { ans = (ans * a) % m; } return ans; } int main() { ll n,d; cin >> n >> d; for (int i = 0; i < n-1; i++) { int a, b; cin >> a >> b; a--, b--; f[a].push_back(b); f[b].push_back(a); } ll x = powe(4, d); if (x < 0) x += m; cout << x; } // Run program: Ctrl + F5 or Debug > Start Without Debugging menu // Debug program: F5 or Debug > Start Debugging menu // Tips for Getting Started: // 1. Use the Solution Explorer window to add/manage files // 2. Use the Team Explorer window to connect to source control // 3. Use the Output window to see build output and other messages // 4. Use the Error List window to view errors // 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project // 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
#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...