# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
944191 | beepbeepsheep | Meetings (IOI18_meetings) | C++17 | 5556 ms | 3920 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 "meetings.h"
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define ll long long
const ll inf=1e18;
std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L,
std::vector<int> R) {
ll n=H.size();
ll q=L.size();
vector<ll> ans;
for (int i=0;i<q;i++){
int tot=0,cnt=0;
for (int j=L[i];j<=R[i];j++){
cnt+=2-H[j];
if (tot<cnt) tot=cnt;
if (H[j]==2) cnt=0;
}
if (tot<cnt) tot=cnt;
ans.emplace_back((R[i]-L[i]+1)*2-tot);
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |