1722 | 2022-12-01 16:48:10 | Metamorphoses | Rendőrségi Üldözés 4 | cpp11 | Time limit exceeded 0/100 | 2.599s | 4280 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;
//cout << zold << "\n";
minlepes++;
if((i+1) == arr[0]){
if(zold)
minlepes+=1;
else{
if(!zold){
if(r > 0){
minlepes++;
r--;
}
else if (r == 0){
// cout << "asd";
minlepes+=(t - ((i+1)%t));
}
}
}
}
//cout << "i = " << i+1 << '\n';
// cout << "Minl " << minlepes << '\n';
}
cout << minlepes;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1880 KiB | ||||
2 | Accepted | 2ms | 2268 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Time limit exceeded | 2.599s | 1328 KiB | ||||
4 | Time limit exceeded | 2.549s | 2388 KiB | ||||
5 | Time limit exceeded | 2.549s | 2632 KiB | ||||
6 | Time limit exceeded | 2.546s | 1880 KiB | ||||
7 | Time limit exceeded | 2.549s | 2176 KiB | ||||
subtask3 | 0/15 | ||||||
8 | Time limit exceeded | 2.569s | 2204 KiB | ||||
9 | Time limit exceeded | 2.562s | 2972 KiB | ||||
10 | Time limit exceeded | 2.549s | 2352 KiB | ||||
11 | Time limit exceeded | 2.561s | 2528 KiB | ||||
subtask4 | 0/15 | ||||||
12 | Wrong answer | 2ms | 3284 KiB | ||||
13 | Wrong answer | 2ms | 3280 KiB | ||||
14 | Wrong answer | 2ms | 3284 KiB | ||||
15 | Wrong answer | 2ms | 3288 KiB | ||||
subtask5 | 0/25 | ||||||
16 | Wrong answer | 2ms | 3412 KiB | ||||
17 | Wrong answer | 2ms | 3640 KiB | ||||
18 | Wrong answer | 2ms | 3556 KiB | ||||
19 | Wrong answer | 2ms | 3688 KiB | ||||
20 | Wrong answer | 2ms | 3892 KiB | ||||
subtask6 | 0/15 | ||||||
21 | Time limit exceeded | 2.599s | 3020 KiB | ||||
22 | Time limit exceeded | 2.556s | 3940 KiB | ||||
23 | Time limit exceeded | 2.538s | 3372 KiB | ||||
24 | Time limit exceeded | 2.573s | 3444 KiB | ||||
25 | Time limit exceeded | 2.585s | 4280 KiB | ||||
subtask7 | 0/20 | ||||||
26 | Time limit exceeded | 2.529s | 3704 KiB | ||||
27 | Time limit exceeded | 2.552s | 3904 KiB | ||||
28 | Time limit exceeded | 2.581s | 3924 KiB | ||||
29 | Time limit exceeded | 2.578s | 3692 KiB | ||||
30 | Time limit exceeded | 2.569s | 3760 KiB |