52082023-04-22 10:46:54anonHázszámokcpp17Time limit exceeded 25/100298ms5664 KiB
#include <vector>
#include <iostream>

using ll = long long;
using namespace std;

int main()
{
    ll i, n, r, K;

    cin >> K;

    vector<ll> d(K);

    for(i = 0; i < K; i++)
        cin >> d[i];

    i = 1;

    while(true)
    {
        n = i;

        while(n > 0)
        {
            r = n % K;
            d[r]--;

            if(d[r] < 0)
            {
                cout << i - 1 << endl;
                return 0;
            }

            n /= K;
        }

        i++;
    }
}

SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1812 KiB
2Accepted10ms2012 KiB
3Time limit exceeded270ms2068 KiB
subtask225/25
4Accepted4ms2360 KiB
5Accepted6ms2468 KiB
6Accepted4ms2684 KiB
7Accepted10ms2812 KiB
8Accepted9ms2956 KiB
9Accepted14ms3284 KiB
10Accepted4ms3212 KiB
11Accepted7ms3444 KiB
12Accepted8ms3532 KiB
13Accepted10ms3668 KiB
14Accepted9ms3596 KiB
15Accepted10ms3684 KiB
16Accepted10ms3656 KiB
17Accepted9ms3784 KiB
18Accepted10ms4000 KiB
19Accepted8ms4216 KiB
subtask30/10
20Time limit exceeded298ms4280 KiB
21Time limit exceeded240ms4284 KiB
22Time limit exceeded264ms4352 KiB
23Accepted3ms4412 KiB
24Time limit exceeded298ms4360 KiB
subtask40/15
25Time limit exceeded231ms4360 KiB
26Time limit exceeded252ms4372 KiB
27Time limit exceeded259ms4488 KiB
28Time limit exceeded252ms4376 KiB
29Time limit exceeded256ms4380 KiB
30Accepted3ms4560 KiB
31Time limit exceeded298ms4736 KiB
32Time limit exceeded259ms4824 KiB
33Time limit exceeded244ms4968 KiB
subtask50/20
34Accepted3ms4872 KiB
35Accepted3ms4880 KiB
36Time limit exceeded270ms4880 KiB
37Time limit exceeded231ms4880 KiB
38Time limit exceeded256ms4984 KiB
39Time limit exceeded252ms4984 KiB
40Time limit exceeded256ms4408 KiB
41Time limit exceeded280ms5120 KiB
42Time limit exceeded263ms5012 KiB
subtask60/30
43Time limit exceeded261ms5012 KiB
44Time limit exceeded256ms4896 KiB
45Time limit exceeded268ms4900 KiB
46Time limit exceeded252ms4908 KiB
47Time limit exceeded268ms5040 KiB
48Time limit exceeded268ms5296 KiB
49Time limit exceeded254ms5264 KiB
50Time limit exceeded259ms5384 KiB
51Time limit exceeded259ms5512 KiB
52Accepted2ms5456 KiB
53Time limit exceeded298ms5512 KiB
54Time limit exceeded298ms5496 KiB
55Time limit exceeded263ms5276 KiB
56Time limit exceeded263ms5380 KiB
57Time limit exceeded272ms5540 KiB
58Time limit exceeded268ms5652 KiB
59Time limit exceeded263ms5068 KiB
60Time limit exceeded247ms5664 KiB