# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
159744 | 2019-10-24T12:09:01 Z | geon040702 | None (KOI16_gasM) | C++14 | 34 ms | 3332 KB |
#include <bits/stdc++.h> using namespace std; long long int dist[100010]; long long int gas[100010]; long long int res; int city; int main(void) { int i; scanf("%d", &city); for(i=1;i<city;i++) { scanf("%lld", &dist[i]); } for(i=1;i<=city;i++) { scanf("%lld", &gas[i]); if(i != 1 && gas[i-1] < gas[i]) { gas[i] = gas[i-1]; } if(i < city) { res += dist[i] * gas[i]; } } printf("%lld\n", res); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 25 ms | 2552 KB | Output is correct |
2 | Correct | 21 ms | 2168 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 380 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 25 ms | 2552 KB | Output is correct |
2 | Correct | 21 ms | 2168 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 380 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 3 ms | 376 KB | Output is correct |
11 | Correct | 5 ms | 632 KB | Output is correct |
12 | Correct | 11 ms | 1272 KB | Output is correct |
13 | Correct | 34 ms | 3332 KB | Output is correct |
14 | Correct | 31 ms | 3320 KB | Output is correct |
15 | Correct | 25 ms | 2680 KB | Output is correct |