| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1347825 | boropoto | Quality Of Living (IOI10_quality) | C++20 | 1 ms | 344 KiB |
#include<bits/stdc++.h>
#include "quality.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T> using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
int rectangle(int R, int C, int H, int W, int q[3001][3001])
{
int r=R,c=C,h=H,w=W,k=h*w/2+1;
int ans=1e18;
for(int i=h-1;i<r;i++)
{
ordered_set<int> s;
for(int a=i-h+1;a<=i;a++)
{
for(int b=w-1;b>=0;b--)
{
s.insert(q[a][b]);
}
}
for(int j=w-1;j<c;j++)
{
auto it=s.find_by_order(k);
ans=min(ans,*it);
if(j==c-1)
{
break;
}
for(int z=i-h+1;z<i;z++)
{
s.erase(q[z][j-w+1]);
}
for(int z=i-h+1;z<i;z++)
{
s.insert(q[z][j+1]);
}
}
}
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... | ||||
