# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
714760 |
2023-03-25T09:06:17 Z |
KING |
Toll (BOI17_toll) |
C++14 |
|
48 ms |
7244 KB |
#include<bits/stdc++.h>
#define NOT_STONKS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
const int maxn = 2e5 + 10; //4e6 + 10; //3e5 + 10;
const int mod = 1e9 + 7; //998244353;
typedef long long ll;
int k, n, m, o, arr[maxn];
ll psum[maxn];
vector< pair<int, int> > G[maxn];
int main() {
NOT_STONKS;
cin >> k >> n >> m >> o;
for (int i = 0; i < m; i++) {
int u, v, w;
cin >> u >> v >> w;
G[u].push_back({ v, w });
arr[v] = w;
}
for (int i = 1; i <= n; i++) psum[i] = psum[i - 1] + arr[i];
while (o--) {
int a, b;
cin >> a >> b;
cout << psum[b] - psum[a] << endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
35 ms |
7244 KB |
Output is correct |
2 |
Incorrect |
3 ms |
5000 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
48 ms |
7176 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
35 ms |
7244 KB |
Output is correct |
2 |
Incorrect |
3 ms |
5000 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |