# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1160082 | ocasu | 3D Histogram (COCI20_histogram) | C++20 | 2590 ms | 19016 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n; cin>>n;
vector<int> a(n), b(n);
for (int i=0; i<n; i++) cin>>a[i]>>b[i];
int ans=0;
//cout<<'\n';
for (int i=0; i<n; i++){
int aL=-1, bL=-1, aR=-1, bR=-1;
for (int j=i-1; j>=0; j--) if (a[j] < a[i]) {
aL=a[j];
break;
}
for (int j=i-1; j>=0; j--) if (b[j] < b[i]) {
bL=b[j];
break;
}
for (int j=i+1; j<n; j++) if (a[j] < a[i]) {
aL=a[j];
break;
}
for (int j=i+1; j<n; j++) if (b[j] < b[i]) {
bL=b[j];
break;
}
//cout<<a[i]<<' '<<b[i]<<'\n';
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |