70742023-12-29 18:16:36MagyarKendeSZLGTakaros Sorozat (80 pont)cpp17Wrong answer 10/808ms4052 KiB
#include <bits/stdc++.h>

#define speed cin.tie(0); ios::sync_with_stdio(0)

using namespace std;

int main() {
    //speed;

    bool done = 0;
    int N, fo = -1;
    char c;
    cin >> N;

    for (int i = 0; i < N; i++) {
        cin >> c;
        if (!done) {
            if (c == '1') {
                fo = i;
                done = 1;
            }
        }
    }

    if (fo <= 0) {
        cout << "0\n0";
        exit(0);
    }

    int len = N - fo - 1;
    cout << len / 2 + (len & 1) << '\n' << len / 4 + (len % 4) / 2 + ((len % 4) & 1);
}
SubtaskSumTestVerdictTimeMemory
base10/80
1Accepted0/03ms1872 KiB
2Wrong answer0/08ms2124 KiB
3Accepted4/43ms2332 KiB
4Wrong answer0/43ms2548 KiB
5Wrong answer0/43ms2700 KiB
6Wrong answer0/43ms2916 KiB
7Wrong answer0/43ms3032 KiB
8Partially correct2/43ms3156 KiB
9Wrong answer0/43ms3360 KiB
10Wrong answer0/43ms3356 KiB
11Wrong answer0/43ms3420 KiB
12Wrong answer0/43ms3420 KiB
13Wrong answer0/48ms3576 KiB
14Wrong answer0/48ms3700 KiB
15Accepted4/48ms3752 KiB
16Wrong answer0/48ms3576 KiB
17Wrong answer0/48ms3580 KiB
18Wrong answer0/48ms3576 KiB
19Wrong answer0/48ms3708 KiB
20Wrong answer0/48ms3916 KiB
21Wrong answer0/48ms3928 KiB
22Wrong answer0/48ms4052 KiB