6196 | 2023-11-06 15:32:02 | Balki22 | Ludak Harca | cpp17 | Accepted 100/100 | 30ms | 5500 KiB |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n; cin >> n;
vector<int> kapu(n);
for (int i = 0; i < n; i++) {
int k; cin >> k;
kapu[i] = k;
}
vector<int> megoldas(6);
for (int i = 1; i <= 6; i++) {
int pos = 0;
int lepesszam = 0;
while (pos <= n-1) {
pos += i;
while (kapu[pos] > 0) {
pos += kapu[pos];
if (pos > n-1) break;
}
lepesszam++;
}
megoldas[i-1] = lepesszam;
}
for (int l : megoldas) {
cout << l << " ";
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1808 KiB | ||||
2 | Accepted | 3ms | 2060 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 3ms | 2216 KiB | ||||
4 | Accepted | 3ms | 2424 KiB | ||||
5 | Accepted | 3ms | 2680 KiB | ||||
6 | Accepted | 4ms | 3056 KiB | ||||
7 | Accepted | 19ms | 3956 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 3ms | 3212 KiB | ||||
9 | Accepted | 3ms | 3260 KiB | ||||
10 | Accepted | 4ms | 3632 KiB | ||||
11 | Accepted | 7ms | 3996 KiB | ||||
12 | Accepted | 12ms | 4060 KiB | ||||
13 | Accepted | 19ms | 4144 KiB | ||||
14 | Accepted | 25ms | 4332 KiB | ||||
15 | Accepted | 28ms | 4600 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 4012 KiB | ||||
17 | Accepted | 7ms | 4028 KiB | ||||
18 | Accepted | 10ms | 4328 KiB | ||||
19 | Accepted | 13ms | 4392 KiB | ||||
20 | Accepted | 14ms | 4304 KiB | ||||
21 | Accepted | 18ms | 4676 KiB | ||||
22 | Accepted | 21ms | 4892 KiB | ||||
23 | Accepted | 25ms | 5216 KiB | ||||
24 | Accepted | 25ms | 5480 KiB | ||||
25 | Accepted | 30ms | 5500 KiB |