2083 | 2022-12-16 20:27:14 | eokor | Ludak Harca | cpp11 | Runtime error 25/100 | 30ms | 5380 KiB |
#include <iostream>
//#include <fstream>
using namespace std;
int main()
{
// ifstream cin("be.txt");
// int n;
// cin>>n;
// int tabla[n],hossz,osszeg[7]={};
// hossz=n;
// cin>>tabla[0];
// int seg;
// while(hossz>6)
// {
// for(int i=1;i<=6;i++)
// {
// cin>>seg;
// tabla[i]=tabla[i]+seg;
// osszeg[i]++;
// }
// for(int i=1;i<=6;i++)
// {
// while(tabla[i]<=6){
// tabla[i]=tabla[i]+tabla[tabla[i]];
// osszeg[i]++;
// }
// tabla[i]=tabla[i]/6*tabla[i]%6;
// }
// hossz-=6;
// }
// for(int i=1;i<=6;i++)
// {
// cout<<osszeg[i]<<" ";
// }
int n;
cin>>n;
int tabla[n],hossz,osszeg[7]={};
hossz=n;
int seg;
for(int i=0;i<n;i++)
{
cin>>tabla[i];
}
for(int i=1;i<=6;i++)
{
int ind=0;
while(ind<n)
{
while(tabla[ind]!=0)
{
ind+=tabla[ind];
}
while(tabla[ind]==0 && ind<n)
{
osszeg[i]++;
ind+=i;
}
}
}
for(int i=1;i<=6;i++)
{
cout<<osszeg[i]<<" ";
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Runtime error | 3ms | 1980 KiB | ||||
2 | Runtime error | 2ms | 2184 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 2ms | 2272 KiB | ||||
4 | Accepted | 2ms | 2476 KiB | ||||
5 | Accepted | 2ms | 2720 KiB | ||||
6 | Accepted | 4ms | 2956 KiB | ||||
7 | Accepted | 19ms | 3856 KiB | ||||
subtask3 | 0/40 | ||||||
8 | Accepted | 2ms | 3288 KiB | ||||
9 | Accepted | 3ms | 3500 KiB | ||||
10 | Accepted | 4ms | 3604 KiB | ||||
11 | Runtime error | 7ms | 3832 KiB | ||||
12 | Accepted | 12ms | 4012 KiB | ||||
13 | Accepted | 18ms | 4308 KiB | ||||
14 | Accepted | 25ms | 4404 KiB | ||||
15 | Accepted | 27ms | 4720 KiB | ||||
subtask4 | 0/35 | ||||||
16 | Accepted | 4ms | 4180 KiB | ||||
17 | Runtime error | 7ms | 4228 KiB | ||||
18 | Accepted | 9ms | 4164 KiB | ||||
19 | Accepted | 13ms | 4468 KiB | ||||
20 | Accepted | 14ms | 4508 KiB | ||||
21 | Accepted | 18ms | 4800 KiB | ||||
22 | Accepted | 21ms | 4976 KiB | ||||
23 | Accepted | 25ms | 5272 KiB | ||||
24 | Accepted | 24ms | 5316 KiB | ||||
25 | Accepted | 30ms | 5380 KiB |