# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
131415 | 2019-07-17T06:49:26 Z | 임유진(#3181) | Sparklers (JOI17_sparklers) | C++14 | 2 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; #define MAXN 100005 typedef long long lint; lint X[MAXN]; int main() { int N, K; lint T; scanf("%d%d%lld", &N, &K, &T); for(int i = 1; i <= N; i++) scanf("%lld", X + i); vector<lint> v1, v2; for(int i = 1; i < K; i++) v1.push_back(X[i + 1] - X[i]); for(int i = N; i > K; i--) v2.push_back(X[i] - X[i - 1]); lint S = 0ll; int cnt = 0; lint ti = 0ll; while(!v1.empty() || !v2.empty()) { if(v2.empty() || (!v1.empty() && v1.back() < v2.back())) { ti += v1.back(); v1.pop_back(); } else { ti += v2.back(); v2.pop_back(); } if(ti > 0) S = max(S, (ti - 1) / (++cnt * T * 2) + 1); } printf("%lld", S); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 252 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 | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Incorrect | 2 ms | 256 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 252 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 | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Incorrect | 2 ms | 256 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 252 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 | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Incorrect | 2 ms | 256 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |