68772023-12-19 13:26:03Spurr007Hőmérsékletekcpp17Time limit exceeded 0/100587ms14672 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Time limit exceeded563ms1844 KiB
2Time limit exceeded561ms2096 KiB
subtask20/7
3Time limit exceeded561ms1652 KiB
4Time limit exceeded558ms1692 KiB
5Time limit exceeded566ms2008 KiB
6Time limit exceeded565ms2224 KiB
7Time limit exceeded550ms4052 KiB
8Time limit exceeded550ms6276 KiB
9Time limit exceeded559ms3396 KiB
subtask30/14
10Time limit exceeded570ms3544 KiB
11Time limit exceeded561ms3596 KiB
12Time limit exceeded565ms4492 KiB
13Time limit exceeded578ms3728 KiB
14Time limit exceeded554ms4596 KiB
15Time limit exceeded550ms4584 KiB
16Time limit exceeded566ms4504 KiB
subtask40/38
17Time limit exceeded546ms4508 KiB
18Time limit exceeded574ms4624 KiB
19Time limit exceeded550ms4556 KiB
20Time limit exceeded569ms4896 KiB
21Time limit exceeded563ms4016 KiB
22Time limit exceeded570ms5796 KiB
23Time limit exceeded563ms6300 KiB
24Time limit exceeded569ms5512 KiB
subtask50/41
25Time limit exceeded586ms6344 KiB
26Time limit exceeded566ms8520 KiB
27Time limit exceeded574ms9292 KiB
28Time limit exceeded587ms9792 KiB
29Time limit exceeded559ms8560 KiB
30Time limit exceeded570ms10828 KiB
31Time limit exceeded563ms11336 KiB
32Time limit exceeded566ms11812 KiB
33Time limit exceeded550ms10624 KiB
34Time limit exceeded559ms10680 KiB
35Time limit exceeded564ms11140 KiB
36Time limit exceeded560ms10768 KiB
37Time limit exceeded555ms10248 KiB
38Time limit exceeded558ms13824 KiB
39Time limit exceeded569ms14672 KiB