17192022-12-01 16:41:54MetamorphosesRendőrségi Üldözés 4cpp11Wrong answer 0/1007ms4576 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1872 KiB
2Wrong answer2ms2128 KiB
subtask20/10
3Runtime error2ms2424 KiB
4Runtime error2ms2652 KiB
5Runtime error2ms2824 KiB
6Runtime error2ms2984 KiB
7Runtime error2ms2932 KiB
subtask30/15
8Runtime error3ms3188 KiB
9Runtime error2ms3368 KiB
10Runtime error3ms3572 KiB
11Runtime error3ms3792 KiB
subtask40/15
12Runtime error2ms3868 KiB
13Wrong answer2ms3996 KiB
14Accepted2ms4012 KiB
15Wrong answer2ms3808 KiB
subtask50/25
16Runtime error2ms4148 KiB
17Runtime error2ms4176 KiB
18Runtime error2ms4056 KiB
19Wrong answer2ms4184 KiB
20Runtime error2ms4140 KiB
subtask60/15
21Runtime error2ms4124 KiB
22Runtime error2ms4088 KiB
23Runtime error2ms4064 KiB
24Runtime error2ms4064 KiB
25Runtime error2ms4072 KiB
subtask70/20
26Runtime error7ms4248 KiB
27Runtime error7ms4360 KiB
28Runtime error7ms4356 KiB
29Runtime error7ms4376 KiB
30Runtime error7ms4576 KiB