Submission #626911

# Submission time Handle Problem Language Result Execution time Memory
626911 2022-08-12T00:46:32 Z kkkkkkkk Radio Towers (IOI22_towers) C++17
0 / 100
4000 ms 1436 KB
#include <bits/stdc++.h>

using namespace std;

vector<int> height;
int N,k=0;

void init(int n,vector<int> H)
{
    N=n;
    height=H;
}

int max_towers(int l,int r,int d)
{
    int res=1;
    for (int i=l;i<=r;i++)
    {
        int max_height=0,how_many=1,preth=height[i];
        for (int j=i+1;j<=r;j++)
        {
            max_height=max(max_height,height[j]);
            if (max_height-height[j]>=d&&max_height-preth>=d)
            {
                how_many++;
                preth=max(preth,height[j]);
                if (preth==height[j])
                    max_height=0;
            }
        }
        res=max(res,how_many);
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 4066 ms 976 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB 1st lines differ - on the 1st token, expected: '13', found: '25'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB 1st lines differ - on the 1st token, expected: '13', found: '25'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4022 ms 1436 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4057 ms 552 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB 1st lines differ - on the 1st token, expected: '13', found: '25'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4066 ms 976 KB Time limit exceeded
2 Halted 0 ms 0 KB -