# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
922708 |
2024-02-06T03:41:18 Z |
Aiperiii |
Wall (IOI14_wall) |
C++14 |
|
3000 ms |
18176 KB |
#include <bits/stdc++.h>
#include "wall.h"
//#define int long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
vector <int> ans(n);
for(int i=0;i<k;i++){
for(int j=left[i];j<=right[i];j++){
if(op[i]==1)ans[j]=max(ans[j],height[i]);
else ans[j]=min(ans[j],height[i]);
}
}
for(int j=0;j<n;j++){
finalHeight[j]=ans[j];
}
return;
}
/*
signed main(){
ios_base::sync_with_stdio();
cin.tie(0);cout.tie(0);
int n,q;
cin>>n>>q;
int type[q],l[q],r[q],h[q],res[q];
for(int i=0;i<q;i++){
cin>>type[i]>>l[i]>>r[i]>>h[i];
}
buildWall(n,q,type,l,r,h,res);
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
16 ms |
608 KB |
Output is correct |
5 |
Correct |
15 ms |
604 KB |
Output is correct |
6 |
Correct |
16 ms |
672 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
118 ms |
13836 KB |
Output is correct |
3 |
Correct |
1049 ms |
4568 KB |
Output is correct |
4 |
Execution timed out |
3042 ms |
18004 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
15 ms |
604 KB |
Output is correct |
5 |
Correct |
16 ms |
672 KB |
Output is correct |
6 |
Correct |
16 ms |
676 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
111 ms |
14064 KB |
Output is correct |
9 |
Correct |
1028 ms |
7628 KB |
Output is correct |
10 |
Execution timed out |
3101 ms |
18176 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
15 ms |
684 KB |
Output is correct |
5 |
Correct |
16 ms |
636 KB |
Output is correct |
6 |
Correct |
16 ms |
604 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
109 ms |
13984 KB |
Output is correct |
9 |
Correct |
1037 ms |
7764 KB |
Output is correct |
10 |
Execution timed out |
3047 ms |
18160 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |