Submission #629544

# Submission time Handle Problem Language Result Execution time Memory
629544 2022-08-14T15:23:56 Z DarkMatter Radio Towers (IOI22_towers) C++17
4 / 100
851 ms 1444 KB
#include<bits/stdc++.h>
#include "towers.h"
#include <vector>
using namespace std;
int idx = -1;
vector<int>v;
void init(int N, std::vector<int> H) {
	for (int i = 1; i < N - 1; i++)
		if (H[i] > H[i - 1] && H[i] > H[i + 1])
			idx = i;
	v = H;
}
int max_towers(int L, int R, int D) {
	if (R <= idx || L >= idx || v[idx] - v[L] < D || v[idx] - v[R] < D)
		return 1;
	return 2;
}
# Verdict Execution time Memory Grader output
1 Correct 380 ms 976 KB Output is correct
2 Correct 851 ms 1436 KB Output is correct
3 Correct 770 ms 1436 KB Output is correct
4 Correct 816 ms 1444 KB Output is correct
5 Correct 780 ms 1436 KB Output is correct
6 Correct 826 ms 1360 KB Output is correct
7 Correct 723 ms 1360 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 1 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
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: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 570 ms 1360 KB 1st lines differ - on the 1st token, expected: '11903', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 141 ms 560 KB 1st lines differ - on the 1st token, expected: '7197', found: '2'
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: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 380 ms 976 KB Output is correct
2 Correct 851 ms 1436 KB Output is correct
3 Correct 770 ms 1436 KB Output is correct
4 Correct 816 ms 1444 KB Output is correct
5 Correct 780 ms 1436 KB Output is correct
6 Correct 826 ms 1360 KB Output is correct
7 Correct 723 ms 1360 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 1 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
11 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
12 Halted 0 ms 0 KB -