1900 | 2022-12-08 10:14:42 | szabel26 | Ludak Harca | cpp17 | Wrong answer 0/100 | 32ms | 5532 KiB |
/*
Kod Kupa Online Selejtezo - Ludak Harca Feladat
Megoldas: O(n^2)
Alapotlet: Lepesenkent "vegigjatsszuk" a tarsast, kulombozo dobokocka ertekekkel.
A szukseges dobasok szamat egy valtozoval figyeljuk, amit majd egy vektorba
beteszunk majd kiirjuk a vektor elemeit.
*/
#include <iostream>
//#include <fstream>
#include <vector>
using namespace std;
//ifstream cin("tarsas.in");
//ofstream cout("tarsas.out");
int n,j,dk,i,a,lepesdb;
vector <int>x;
vector <int>lepes;
int main()
{
cin>>n;
for(i=1;i<=n;++i)
{
cin>>a;
x.push_back(a);
}
for(dk=1;dk<=6;++dk)
{
i=0;
lepesdb=0;
while(i<n)
{
i+=dk;
++lepesdb;
if(x[i]!=0) i+=x[i];
else{
i+=dk;
++lepesdb;
}
}
lepes.push_back(lepesdb);
}
for(auto &e:lepes) cout<<e<<" ";
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1880 KiB | ||||
2 | Wrong answer | 2ms | 2212 KiB | ||||
subtask2 | 0/25 | ||||||
3 | Wrong answer | 2ms | 2220 KiB | ||||
4 | Wrong answer | 2ms | 2468 KiB | ||||
5 | Wrong answer | 2ms | 2552 KiB | ||||
6 | Wrong answer | 4ms | 2980 KiB | ||||
7 | Wrong answer | 19ms | 4148 KiB | ||||
subtask3 | 0/40 | ||||||
8 | Wrong answer | 2ms | 3412 KiB | ||||
9 | Wrong answer | 3ms | 3436 KiB | ||||
10 | Wrong answer | 4ms | 3600 KiB | ||||
11 | Wrong answer | 7ms | 3868 KiB | ||||
12 | Wrong answer | 12ms | 4256 KiB | ||||
13 | Wrong answer | 19ms | 4836 KiB | ||||
14 | Wrong answer | 25ms | 4900 KiB | ||||
15 | Wrong answer | 27ms | 4904 KiB | ||||
subtask4 | 0/35 | ||||||
16 | Wrong answer | 4ms | 4048 KiB | ||||
17 | Wrong answer | 7ms | 4084 KiB | ||||
18 | Wrong answer | 9ms | 4196 KiB | ||||
19 | Wrong answer | 13ms | 4516 KiB | ||||
20 | Wrong answer | 14ms | 4592 KiB | ||||
21 | Wrong answer | 18ms | 4632 KiB | ||||
22 | Wrong answer | 21ms | 5148 KiB | ||||
23 | Wrong answer | 26ms | 5320 KiB | ||||
24 | Wrong answer | 25ms | 5532 KiB | ||||
25 | Wrong answer | 32ms | 5524 KiB |