9860 | 2024-03-12 15:58:38 | turitamas | Ludak Harca | cpp17 | Accepted 100/100 | 32ms | 4308 KiB |
#include <iostream>
using namespace std;
int main()
{
/*
15
2 3 5 0 7 1 2 0 3 3 2 4 0 3 2
*/
int n;
cin>>n;
int j[n];
for(int i=0;i<n;i++)
{
cin>>j[i];
}
// 3at gurit
for(int i=1;i<=6;i++)
{
int ind=0, uj=0, dobas=0;
do
{
if(j[ind]>0)
uj+=j[ind];
else
{
uj+=j[ind]+i;
dobas++;
}
ind=uj;
}
while(ind<n);
cout<<dobas<<" ";
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1876 KiB | ||||
2 | Accepted | 3ms | 2116 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 3ms | 2316 KiB | ||||
4 | Accepted | 3ms | 2364 KiB | ||||
5 | Accepted | 3ms | 2492 KiB | ||||
6 | Accepted | 4ms | 2612 KiB | ||||
7 | Accepted | 20ms | 3360 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 3ms | 2816 KiB | ||||
9 | Accepted | 3ms | 2908 KiB | ||||
10 | Accepted | 4ms | 2940 KiB | ||||
11 | Accepted | 7ms | 3048 KiB | ||||
12 | Accepted | 12ms | 3256 KiB | ||||
13 | Accepted | 19ms | 3628 KiB | ||||
14 | Accepted | 25ms | 3788 KiB | ||||
15 | Accepted | 28ms | 3980 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 3504 KiB | ||||
17 | Accepted | 7ms | 3476 KiB | ||||
18 | Accepted | 10ms | 3440 KiB | ||||
19 | Accepted | 14ms | 3728 KiB | ||||
20 | Accepted | 14ms | 3856 KiB | ||||
21 | Accepted | 19ms | 3896 KiB | ||||
22 | Accepted | 23ms | 4064 KiB | ||||
23 | Accepted | 26ms | 4100 KiB | ||||
24 | Accepted | 25ms | 4144 KiB | ||||
25 | Accepted | 32ms | 4308 KiB |