164522025-04-30 17:32:23algoproKéséscpp17Wrong answer 0/50439ms3028 KiB
// UUID: f33b5fa1-f563-4be0-b0fd-cc6981f92a23
#include <bits/stdc++.h>
using namespace std;


int main() {
    int n;
    cin >> n;
    vector<int> years(n+5);
    int l=0,r=0;
    for (int i = 0; i < n; ++i) {
        cin >> years[i];
    }
    while(r<n){
        if(years[r]==years[l]&&r>l){
            l++;
        }
        else{
            r++;
        }
        cout<<l<<" "<<r<<endl;;
    }
    

    cout << l+1 << '\n'; 
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/035ms564 KiB
3Wrong answer0/53ms496 KiB
4Wrong answer0/53ms328 KiB
5Wrong answer0/5375ms3028 KiB
6Wrong answer0/5377ms2984 KiB
7Wrong answer0/4412ms2724 KiB
8Wrong answer0/4400ms2868 KiB
9Wrong answer0/4400ms2868 KiB
10Wrong answer0/4400ms2732 KiB
11Wrong answer0/4409ms2732 KiB
12Wrong answer0/2421ms2872 KiB
13Wrong answer0/2425ms2860 KiB
14Wrong answer0/1428ms2872 KiB
15Wrong answer0/1432ms2736 KiB
16Wrong answer0/1425ms2736 KiB
17Wrong answer0/1439ms2772 KiB
18Wrong answer0/1416ms2740 KiB
19Wrong answer0/1412ms2988 KiB