Submission #626909

# Submission time Handle Problem Language Result Execution time Memory
626909 2022-08-12T00:34:57 Z kkkkkkkk Radio Towers (IOI22_towers) C++17
0 / 100
4000 ms 1444 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]);
            }
        }
        res=max(res,how_many);
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 4043 ms 932 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '38'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '38'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4027 ms 1444 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4056 ms 556 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '38'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4043 ms 932 KB Time limit exceeded
2 Halted 0 ms 0 KB -