Submission #1103969

# Submission time Handle Problem Language Result Execution time Memory
1103969 2024-10-22T13:41:51 Z vjudge1 Wall (IOI14_wall) C++17
8 / 100
3000 ms 13888 KB
#include "wall.h"
#include<iostream>
using namespace std;
const int N=2000000;
int seg[4*N+7];

void update(int l,int r,int idx1,int idx2,int val,int node,int mode){
    if(l>idx2 || r<idx1) return ;
    if(l==r){
        if(mode==1) seg[node]=max(seg[node],val);
        else seg[node]=min(seg[node],val);
        return ;
    }
    int mid=(l+r)>>1;
    update(l,mid,idx1,idx2,val,node*2,mode);
    update(mid+1,r,idx1,idx2,val,node*2+1,mode);
}

void print(int l,int r,int idx1,int idx2, int node,int arr[]){
    if(l>idx2 && r<idx1) return ;
    if(l==r){
        arr[l-1]=seg[node];
        return ;
    }
    int mid=(l+r)>>1;
    print(l,mid,idx1,idx2,node*2,arr);
    print(mid+1,r,idx1,idx2,node*2+1,arr);
}
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
    for (int i=0;i<k;++i) {
        update(1, n, left[i]+1, right[i]+1, height[i], 1, op[i]);
    }
    print(1,n,1,n,1,finalHeight);
    return;
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 2 ms 536 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 68 ms 592 KB Output is correct
5 Correct 68 ms 592 KB Output is correct
6 Correct 69 ms 592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 103 ms 8104 KB Output is correct
3 Execution timed out 3064 ms 3728 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 77 ms 736 KB Output is correct
5 Correct 68 ms 760 KB Output is correct
6 Correct 68 ms 592 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 80 ms 8036 KB Output is correct
9 Execution timed out 3070 ms 7496 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 2 ms 336 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 68 ms 592 KB Output is correct
5 Correct 83 ms 848 KB Output is correct
6 Correct 68 ms 592 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 92 ms 13888 KB Output is correct
9 Execution timed out 3070 ms 7552 KB Time limit exceeded
10 Halted 0 ms 0 KB -