1719 | 2022-12-01 16:41:54 | Metamorphoses | Rendőrségi Üldözés 4 | cpp11 | Wrong answer 0/100 | 7ms | 4576 KiB |
#include <iostream>
using namespace std;
int main()
{
int n,r,t,l;
cin >>n >>r>>t>>l;
int arr[n];
for(int i = 0; i < n; i++)
cin >> arr[i];
bool zold = true;
int minlepes = 0;
for(int i = 0; i < l; i++)
{
if((i+1)%t == 0)
zold = !zold;
minlepes++;
if(i+1 == arr[i]){
if(zold)
minlepes+=1;
else{
if(!zold){
if(r > 0){
minlepes++;
r--;
}
else{
minlepes+=(t - (i+1)%t);
}
}
}
}
}
cout << minlepes;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1872 KiB | ||||
2 | Wrong answer | 2ms | 2128 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Runtime error | 2ms | 2424 KiB | ||||
4 | Runtime error | 2ms | 2652 KiB | ||||
5 | Runtime error | 2ms | 2824 KiB | ||||
6 | Runtime error | 2ms | 2984 KiB | ||||
7 | Runtime error | 2ms | 2932 KiB | ||||
subtask3 | 0/15 | ||||||
8 | Runtime error | 3ms | 3188 KiB | ||||
9 | Runtime error | 2ms | 3368 KiB | ||||
10 | Runtime error | 3ms | 3572 KiB | ||||
11 | Runtime error | 3ms | 3792 KiB | ||||
subtask4 | 0/15 | ||||||
12 | Runtime error | 2ms | 3868 KiB | ||||
13 | Wrong answer | 2ms | 3996 KiB | ||||
14 | Accepted | 2ms | 4012 KiB | ||||
15 | Wrong answer | 2ms | 3808 KiB | ||||
subtask5 | 0/25 | ||||||
16 | Runtime error | 2ms | 4148 KiB | ||||
17 | Runtime error | 2ms | 4176 KiB | ||||
18 | Runtime error | 2ms | 4056 KiB | ||||
19 | Wrong answer | 2ms | 4184 KiB | ||||
20 | Runtime error | 2ms | 4140 KiB | ||||
subtask6 | 0/15 | ||||||
21 | Runtime error | 2ms | 4124 KiB | ||||
22 | Runtime error | 2ms | 4088 KiB | ||||
23 | Runtime error | 2ms | 4064 KiB | ||||
24 | Runtime error | 2ms | 4064 KiB | ||||
25 | Runtime error | 2ms | 4072 KiB | ||||
subtask7 | 0/20 | ||||||
26 | Runtime error | 7ms | 4248 KiB | ||||
27 | Runtime error | 7ms | 4360 KiB | ||||
28 | Runtime error | 7ms | 4356 KiB | ||||
29 | Runtime error | 7ms | 4376 KiB | ||||
30 | Runtime error | 7ms | 4576 KiB |