1899 | 2022-12-08 10:11:56 | szabel26 | Ludak Harca | cpp17 | Wrong answer 0/100 | 32ms | 5524 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 | 2000 KiB | ||||
subtask2 | 0/25 | ||||||
3 | Wrong answer | 2ms | 2244 KiB | ||||
4 | Wrong answer | 2ms | 2492 KiB | ||||
5 | Wrong answer | 2ms | 2704 KiB | ||||
6 | Wrong answer | 4ms | 3088 KiB | ||||
7 | Wrong answer | 19ms | 4020 KiB | ||||
subtask3 | 0/40 | ||||||
8 | Wrong answer | 2ms | 3112 KiB | ||||
9 | Wrong answer | 3ms | 3200 KiB | ||||
10 | Wrong answer | 4ms | 3548 KiB | ||||
11 | Wrong answer | 7ms | 3752 KiB | ||||
12 | Wrong answer | 12ms | 4344 KiB | ||||
13 | Wrong answer | 19ms | 4784 KiB | ||||
14 | Wrong answer | 25ms | 4944 KiB | ||||
15 | Wrong answer | 28ms | 4928 KiB | ||||
subtask4 | 0/35 | ||||||
16 | Wrong answer | 4ms | 4280 KiB | ||||
17 | Wrong answer | 7ms | 4420 KiB | ||||
18 | Wrong answer | 10ms | 4828 KiB | ||||
19 | Wrong answer | 13ms | 4944 KiB | ||||
20 | Wrong answer | 14ms | 5012 KiB | ||||
21 | Wrong answer | 18ms | 5016 KiB | ||||
22 | Wrong answer | 23ms | 5516 KiB | ||||
23 | Wrong answer | 26ms | 5520 KiB | ||||
24 | Wrong answer | 25ms | 5516 KiB | ||||
25 | Wrong answer | 32ms | 5524 KiB |