Submission #557148

# Submission time Handle Problem Language Result Execution time Memory
557148 2022-05-04T19:33:20 Z n0sk1ll Rice Hub (IOI11_ricehub) C++14
68 / 100
1000 ms 884 KB
#include "ricehub.h"
#include<bits/stdc++.h>

using namespace std;
long long int typedef li;

int besthub(int n, int m, int x[], li b)
{
    int kolko=0;
    for (int i=0;i<n;i++)
    {
        vector<int> pom;
        for (int j=0;j<n;j++) pom.push_back(abs(x[i]-x[j]));
        sort(pom.begin(),pom.end());

        li tmp=b; int sta=0;
        for (int j=0;j<n;j++)
        {
            if (pom[j]>tmp) break;
            sta++; tmp-=pom[j];
        }
        kolko=max(kolko,sta);
    }
    return kolko;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Correct 0 ms 312 KB Output is correct
4 Correct 1 ms 316 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 316 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 316 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 3 ms 212 KB Output is correct
22 Correct 3 ms 304 KB Output is correct
23 Correct 6 ms 212 KB Output is correct
24 Correct 6 ms 308 KB Output is correct
25 Correct 6 ms 312 KB Output is correct
26 Correct 6 ms 308 KB Output is correct
27 Correct 6 ms 212 KB Output is correct
28 Correct 5 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 2 ms 212 KB Output is correct
3 Correct 17 ms 212 KB Output is correct
4 Correct 17 ms 328 KB Output is correct
5 Correct 3 ms 212 KB Output is correct
6 Correct 4 ms 316 KB Output is correct
7 Correct 12 ms 212 KB Output is correct
8 Correct 16 ms 324 KB Output is correct
9 Correct 5 ms 312 KB Output is correct
10 Correct 6 ms 308 KB Output is correct
11 Correct 13 ms 212 KB Output is correct
12 Correct 14 ms 328 KB Output is correct
13 Correct 24 ms 212 KB Output is correct
14 Correct 28 ms 212 KB Output is correct
15 Correct 6 ms 212 KB Output is correct
16 Correct 8 ms 312 KB Output is correct
17 Correct 15 ms 212 KB Output is correct
18 Correct 13 ms 212 KB Output is correct
19 Correct 22 ms 212 KB Output is correct
20 Correct 21 ms 212 KB Output is correct
21 Correct 361 ms 444 KB Output is correct
22 Correct 354 ms 340 KB Output is correct
23 Correct 735 ms 396 KB Output is correct
24 Correct 755 ms 392 KB Output is correct
25 Correct 662 ms 408 KB Output is correct
26 Correct 683 ms 428 KB Output is correct
27 Correct 627 ms 404 KB Output is correct
28 Correct 607 ms 404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1081 ms 884 KB Time limit exceeded
2 Halted 0 ms 0 KB -