# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1040213 | vnm06 | Catfish Farm (IOI22_fish) | C++17 | 298 ms | 65872 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>
#include "fish.h"
#include <vector>
using namespace std;
int n, m;
vector<long long> sums[100005], height[100005];
vector<long long> dp[100005], dp2[100005], best_dp[100005];
vector<pair<int, int> > pos[100005];
long long bests[100005];
long long bests_osak[100005];
long long get_sum(int row, int k)
{
if(row<0 || row>=n) return 0;
if(sums[row].size()==0) return 0;
int t=sums[row].size();
if(pos[row][0].first>k) return 0;
if(pos[row][t-1].first<=k) return sums[row][t-1];
int le=0, ri=t;
while(ri-le>1)
{
int mid=((le+ri)>>1);
if(pos[row][mid-1].first<=k) le=mid;
else ri=mid;
}
return sums[row][le-1];
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |