9750 | 2024-03-06 11:55:35 | UnluckY | Hőmérsékletek | cpp17 | Wrong answer 0/100 | 46ms | 13524 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, e; cin >> n >> e;
vector<int> v;
for (int i = 0; i < n; i++){
int a; cin >> a; v.push_back(a);
}
int b = -1, j = -1, curr = 0;
bool vanerossz = false;
int maxi = 0;
pair<int, int> maxis = {0, 0};
while (b < n-1 && j < n-1){
while (curr <= e && !vanerossz && j < n-1){
j++;
if (v[j] < 15 || v[j] > 25) curr++;
if (v[j] < 10 || v[j] > 30) vanerossz = true;
if (j-b > maxi && curr <= e && !vanerossz && j < n){
maxi = j-b;
maxis = {b, j};
}
}
b++;
if (v[b] < 15 || v[b] > 25) curr--;
if (v[b] < 10 || v[b] > 30) vanerossz = false;
}
cout << maxis.first+2 << " " << maxis.second+1 << endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1856 KiB | ||||
2 | Accepted | 3ms | 2092 KiB | ||||
subtask2 | 0/7 | ||||||
3 | Accepted | 3ms | 2428 KiB | ||||
4 | Accepted | 3ms | 2588 KiB | ||||
5 | Accepted | 3ms | 2576 KiB | ||||
6 | Accepted | 4ms | 2956 KiB | ||||
7 | Accepted | 24ms | 4260 KiB | ||||
8 | Accepted | 46ms | 5824 KiB | ||||
9 | Wrong answer | 3ms | 4012 KiB | ||||
subtask3 | 0/14 | ||||||
10 | Accepted | 3ms | 4084 KiB | ||||
11 | Accepted | 3ms | 4100 KiB | ||||
12 | Accepted | 3ms | 4096 KiB | ||||
13 | Accepted | 3ms | 4232 KiB | ||||
14 | Accepted | 3ms | 4336 KiB | ||||
15 | Wrong answer | 3ms | 4496 KiB | ||||
16 | Wrong answer | 3ms | 4452 KiB | ||||
subtask4 | 0/38 | ||||||
17 | Accepted | 3ms | 4348 KiB | ||||
18 | Accepted | 3ms | 4420 KiB | ||||
19 | Accepted | 3ms | 4424 KiB | ||||
20 | Accepted | 4ms | 4660 KiB | ||||
21 | Accepted | 4ms | 4840 KiB | ||||
22 | Accepted | 23ms | 6132 KiB | ||||
23 | Accepted | 24ms | 6412 KiB | ||||
24 | Wrong answer | 3ms | 5348 KiB | ||||
subtask5 | 0/41 | ||||||
25 | Accepted | 23ms | 6728 KiB | ||||
26 | Accepted | 46ms | 8172 KiB | ||||
27 | Accepted | 45ms | 8932 KiB | ||||
28 | Accepted | 46ms | 9568 KiB | ||||
29 | Accepted | 21ms | 8932 KiB | ||||
30 | Accepted | 45ms | 10352 KiB | ||||
31 | Accepted | 45ms | 10940 KiB | ||||
32 | Accepted | 45ms | 11528 KiB | ||||
33 | Accepted | 21ms | 11124 KiB | ||||
34 | Accepted | 21ms | 11400 KiB | ||||
35 | Accepted | 21ms | 11512 KiB | ||||
36 | Wrong answer | 3ms | 10528 KiB | ||||
37 | Wrong answer | 3ms | 10536 KiB | ||||
38 | Accepted | 43ms | 12952 KiB | ||||
39 | Accepted | 43ms | 13524 KiB |