답안 #659475

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
659475 2022-11-17T20:55:34 Z Lobo Star Trek (CEOI20_startrek) C++17
0 / 100
1000 ms 12064 KB
    #include<bits/stdc++.h>
    using namespace std;
    const long long inf = (long long) 1e18 + 10;
    const int inf1 = (int) 1e9 + 10;
    #define int long long
    #define dbl long double
    #define endl '\n'
    #define sc second
    #define fr first
    #define mp make_pair
    #define pb push_back
    #define all(x) x.begin(), x.end()

    const int maxn = 5e5+10;
    const int mod = 1e9+7;

    int n, d;
    vector<pair<int,int>> g[maxn];
    void solve() {
        cin >> n >> d;

        for(int i = 1; i <= n-1; i++) {
            int u,v; cin >> u >> v;
            int idu = g[u].size();
            int idv = g[v].size();
            g[u].pb(mp(v,idv));
            g[v].pb(mp(u,idu));
        }
        int ans = 1;
        for(int i = 1; i <= 2*d; i++) {
            ans = ans*2%mod;
        }
        cout << ans << endl;
        

    }

    int32_t main() {
        ios::sync_with_stdio(false); cin.tie(0);

        // freopen("in.in", "r", stdin);
        // freopen("out.out", "w", stdout);
        int tt = 1;
        // cin >> tt;
        while(tt--) {
            solve();
        }

    }
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 11988 KB Output is correct
2 Incorrect 7 ms 12064 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 11996 KB Output is correct
2 Correct 6 ms 11968 KB Output is correct
3 Execution timed out 1077 ms 11988 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11988 KB Output is correct
2 Incorrect 9 ms 11992 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11988 KB Output is correct
2 Incorrect 9 ms 11992 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11988 KB Output is correct
2 Incorrect 9 ms 11992 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11988 KB Output is correct
2 Incorrect 9 ms 11992 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11988 KB Output is correct
2 Incorrect 9 ms 11992 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 11988 KB Output is correct
2 Incorrect 7 ms 12064 KB Output isn't correct
3 Halted 0 ms 0 KB -