Submission #1100788

#TimeUsernameProblemLanguageResultExecution timeMemory
1100788Dan4LifeWall (IOI14_wall)C++17
8 / 100
3060 ms22120 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = (int)2e6+10; const int INF = (int)1e9; int n, A[mxN], B[mxN]; void buildWall(int N, int k, int o[], int l[], int r[], int h[], int ans[]){ n = N; for(int i = 0; i < n; i++) A[i]=INF,B[i]=-INF; for(int i = 0; i < k; i++){ int a, b; if(o[i]==1) a = INF, b = h[i]; else a = h[i], b = -INF; for(int j = l[i]; j <= r[i]; j++){ A[j] = min(a, max(A[j],b)); B[j] = max(B[j],b); } } for(int i = 0; i < n; i++) ans[i] = min(A[i],max(ans[i],B[i])); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...