Submission #136853

# Submission time Handle Problem Language Result Execution time Memory
136853 2019-07-26T11:11:36 Z reda Wall (IOI14_wall) C++14
0 / 100
2 ms 256 KB
#include<bits/stdc++.h>

using namespace std ;
void buildWall(int n, int k, int op[], int left[], int right[],int height[], int finalHeight[])
{
    for(int i=0;i<n;i++)finalHeight[i]=0;
    for(int i=0;i<k;i++)
    {
        int l=left[i],r=right[i];
        int h=height[i];
        if(op[i]==1)
        {
            for(int j=l-1;j<r;j++)
            {
                if(finalHeight[j]<h)
                {
                    finalHeight[j]+=h-finalHeight[j];
                }
            }
        }
        else{
            for(int j=l-1;j<r;j++)
            {
                if(finalHeight[j]>h)
                {
                    finalHeight[j]-=-h+finalHeight[j];
                }
            }
    }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 252 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -