# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
533135 | couplefire | Sparklers (JOI17_sparklers) | C++17 | 28 ms | 2504 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n; cin >> n;
int k; cin >> k;
int T; cin >> T; k--;
vector<int> v(n);
vector<ll> d(n);
auto check = [&](int m) {
for(int i = 0 ; i < n ; ++i)
d[i] = 2ll * T * i * m - v[i];
int pl = k, nl = k - 1;
int pr = k, nr = k + 1;
while (1) {
while (d[nl] > d[pl] && d[nl] <= d[pr] && nl > 0) nl--;
while (d[nr] < d[pr] && d[nr] >= d[pl] && nr < n - 1) nr++;
bool ok = 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |