6877 | 2023-12-19 13:26:03 | Spurr007 | Hőmérsékletek | cpp17 | Time limit exceeded 0/100 | 587ms | 14672 KiB |
#include <iostream>
#include <algorithm>
using namespace std;
struct eredmeny{
int kezdo;
int vege;
int db;
};
bool rendez(eredmeny a, eredmeny b)
{
if(a.db>b.db)
return true;
else if(a.db==b.db)
return true;
return false;
}
int main()
{
int n, e, db=0, j;
cin>>n>>e;
int t[n];
eredmeny a[n];
for(int i=0; i<n; i++)
{
cin>>t[i];
}
for(int i=0; i<n; i++)
{
a[i].kezdo=i;
while(e!=0 || (t[i]<=30 && t[i]>=10))
{
for(int j=i; j<n; j++)
{
if(t[i]>=15 && t[i]<=25)
db++;
else if((t[i]>=10 && t[i]<=14) || (t[i]>=26 && t[i]<=30))
{
db++;
e--;
}
}
a[i].vege=j;
}
a[i].db=db;
}
sort(a, a+n, rendez);
cout<<a[0].kezdo<<" "<<a[0].vege;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Time limit exceeded | 563ms | 1844 KiB | ||||
2 | Time limit exceeded | 561ms | 2096 KiB | ||||
subtask2 | 0/7 | ||||||
3 | Time limit exceeded | 561ms | 1652 KiB | ||||
4 | Time limit exceeded | 558ms | 1692 KiB | ||||
5 | Time limit exceeded | 566ms | 2008 KiB | ||||
6 | Time limit exceeded | 565ms | 2224 KiB | ||||
7 | Time limit exceeded | 550ms | 4052 KiB | ||||
8 | Time limit exceeded | 550ms | 6276 KiB | ||||
9 | Time limit exceeded | 559ms | 3396 KiB | ||||
subtask3 | 0/14 | ||||||
10 | Time limit exceeded | 570ms | 3544 KiB | ||||
11 | Time limit exceeded | 561ms | 3596 KiB | ||||
12 | Time limit exceeded | 565ms | 4492 KiB | ||||
13 | Time limit exceeded | 578ms | 3728 KiB | ||||
14 | Time limit exceeded | 554ms | 4596 KiB | ||||
15 | Time limit exceeded | 550ms | 4584 KiB | ||||
16 | Time limit exceeded | 566ms | 4504 KiB | ||||
subtask4 | 0/38 | ||||||
17 | Time limit exceeded | 546ms | 4508 KiB | ||||
18 | Time limit exceeded | 574ms | 4624 KiB | ||||
19 | Time limit exceeded | 550ms | 4556 KiB | ||||
20 | Time limit exceeded | 569ms | 4896 KiB | ||||
21 | Time limit exceeded | 563ms | 4016 KiB | ||||
22 | Time limit exceeded | 570ms | 5796 KiB | ||||
23 | Time limit exceeded | 563ms | 6300 KiB | ||||
24 | Time limit exceeded | 569ms | 5512 KiB | ||||
subtask5 | 0/41 | ||||||
25 | Time limit exceeded | 586ms | 6344 KiB | ||||
26 | Time limit exceeded | 566ms | 8520 KiB | ||||
27 | Time limit exceeded | 574ms | 9292 KiB | ||||
28 | Time limit exceeded | 587ms | 9792 KiB | ||||
29 | Time limit exceeded | 559ms | 8560 KiB | ||||
30 | Time limit exceeded | 570ms | 10828 KiB | ||||
31 | Time limit exceeded | 563ms | 11336 KiB | ||||
32 | Time limit exceeded | 566ms | 11812 KiB | ||||
33 | Time limit exceeded | 550ms | 10624 KiB | ||||
34 | Time limit exceeded | 559ms | 10680 KiB | ||||
35 | Time limit exceeded | 564ms | 11140 KiB | ||||
36 | Time limit exceeded | 560ms | 10768 KiB | ||||
37 | Time limit exceeded | 555ms | 10248 KiB | ||||
38 | Time limit exceeded | 558ms | 13824 KiB | ||||
39 | Time limit exceeded | 569ms | 14672 KiB |