70692023-12-29 11:18:52MagyarKendeSZLGBejgli (80 pont)cpp17Wrong answer 44/8032ms4952 KiB
#include <bits/stdc++.h>

#define speed cin.tie(0); ios::sync_with_stdio(0)
#define cinv(v) for (auto& e : v) cin >> e;
#define all(v) v.begin(), v.end()

using namespace std;
using ll = long long;
using point = array<int, 2>;

int main() {
    //speed;

    int N, count = 0, most = 0, most_s = 0;
    cin >> N;
    vector<int> B(N);
    cinv(B);

    map<int, int> m;
    for (int i = 0; i < N; count++) {
        m[B[i]]++;
        i += B[i];
    }
    for (auto [s, db] : m) {
        if (most_s < s) {
            most_s = s;
            most = db;
        }
    }
    cout << count << '\n' << most;
}
SubtaskSumTestVerdictTimeMemory
base44/80
1Accepted0/03ms1808 KiB
2Wrong answer0/03ms2004 KiB
3Partially correct2/43ms2248 KiB
4Partially correct2/43ms2424 KiB
5Accepted4/43ms2512 KiB
6Partially correct2/43ms2508 KiB
7Partially correct2/43ms2648 KiB
8Accepted4/43ms2860 KiB
9Partially correct2/43ms3096 KiB
10Partially correct2/43ms3148 KiB
11Partially correct2/43ms3300 KiB
12Partially correct2/44ms3516 KiB
13Partially correct2/44ms3604 KiB
14Partially correct2/44ms3616 KiB
15Partially correct2/46ms3972 KiB
16Partially correct2/46ms4196 KiB
17Partially correct2/413ms4388 KiB
18Partially correct2/419ms4696 KiB
19Partially correct2/426ms4700 KiB
20Partially correct2/426ms4700 KiB
21Partially correct2/432ms4696 KiB
22Partially correct2/421ms4952 KiB