6194 | 2023-11-06 15:24:49 | Balki22 | Bevásárlás | cpp11 | Wrong answer 0/100 | 3ms | 4396 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 | Wrong answer | 3ms | 1964 KiB | ||||
2 | Wrong answer | 3ms | 2016 KiB | ||||
3 | Wrong answer | 3ms | 2232 KiB | ||||
subtask2 | 0/10 | ||||||
4 | Wrong answer | 3ms | 2472 KiB | ||||
5 | Wrong answer | 3ms | 2592 KiB | ||||
6 | Wrong answer | 3ms | 2744 KiB | ||||
subtask3 | 0/20 | ||||||
7 | Wrong answer | 3ms | 3036 KiB | ||||
8 | Wrong answer | 3ms | 3136 KiB | ||||
9 | Wrong answer | 3ms | 3216 KiB | ||||
10 | Wrong answer | 3ms | 3256 KiB | ||||
subtask4 | 0/30 | ||||||
11 | Wrong answer | 3ms | 3476 KiB | ||||
12 | Wrong answer | 3ms | 3364 KiB | ||||
13 | Wrong answer | 3ms | 3564 KiB | ||||
14 | Wrong answer | 3ms | 3776 KiB | ||||
subtask5 | 0/40 | ||||||
15 | Wrong answer | 3ms | 3992 KiB | ||||
16 | Wrong answer | 3ms | 4060 KiB | ||||
17 | Wrong answer | 3ms | 4296 KiB | ||||
18 | Wrong answer | 2ms | 4272 KiB | ||||
19 | Wrong answer | 2ms | 4280 KiB | ||||
20 | Wrong answer | 3ms | 4396 KiB |