#include<bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
using namespace std;
// mt19937 rnd (chrono::steady_clock::now().time_since_epoch().count());
#define sz(s) int(s.size())
#define ll long long
#define ull unsigned long long
#define F first
#define S second
#define pb push_back
#define all(v) v.begin(), v.end()
// #define int ll
#define all(v) v.begin(), v.end()
#define file(s) freopen(s".in", "r", stdin); freopen(s".out", "w", stdout)
const int N=2e5+7, mod=1e9+7, Mod=998244353;
void solve() {
int n;
cin>>n;
ll s=0;
for(int i=1; i<n; i++) {
int a, b, c;
cin>>a>>b>>c;
s+=c;
}
int q;
cin>>q;
while(q--) {
cout << s << '\n';
}
}
signed main() {
// file("floor4");
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int T=1;
// cin>>T;
while(T--)solve();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
8 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
8 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
8 ms |
340 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |