# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
13351 | gs14004 | 수족관 1 (KOI13_aqua1) | C++14 | 0 ms | 1244 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 <cstdio>
#include <utility>
#include <map>
#include <algorithm>
using namespace std;
typedef pair<int,int> pi;
int x[2505], y[2505], hole[2505], n;
map<pi,int> mp;
int h;
int f(int s, int e){
if(s >= e) return 0;
int pos = (int)(min_element(y+s,y+e)-y);
int ret = 0;
if(hole[pos] == 0) ret += (x[e] - x[s]) * (y[pos] - h);
int ph = h;
h = y[pos];
ret += f(s,pos) + f(pos+1,e);
h = ph;
return ret;
}
int main(){
scanf("%d",&n);
n/=2;
for (int i=0; i<n; i++) {
int p,q;
scanf("%d %d %d %d",&p,&q,&x[i],&y[i]);
# | 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... |