# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
533868 | someone | Snowball (JOI21_ho_t2) | C++14 | 310 ms | 26180 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>
#define int long long
using namespace std;
const int N = 2e5 + 42, INF = 1e18;
set<pair<int, int>> inter;
int n, d, pos[N], dep[N], mini[N], maxi[N];
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n >> d;
pos[0] = -INF;
pos[n+1] = INF;
for(int i = 1; i <= n; i++)
cin >> pos[i];
for(int i = 1; i <= d; i++) {
cin >> dep[i];
dep[i] += dep[i-1];
mini[i] = min(mini[i-1], dep[i]);
maxi[i] = max(maxi[i-1], dep[i]);
inter.insert({maxi[i] - mini[i], i});
}
for(int i = 1; i <= n; i++) {
int ans = 0,
pre = pos[i] - pos[i-1],
aft = pos[i+1] - pos[i];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |