QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#297352#6628. Flip it and Stick itMax_s_xaM18 2ms5964kbC++147.6kb2024-01-04 12:04:182024-01-04 12:04:18

Judging History

你现在查看的是最新测评结果

  • [2024-01-04 12:04:18]
  • 评测
  • 测评结果:18
  • 用时:2ms
  • 内存:5964kb
  • [2024-01-04 12:04:18]
  • 提交

answer

#include <iostream>
#include <algorithm>
#include <cstring>

typedef long long ll;
typedef double lf;

// #define DEBUG 1
struct IO
{
    #define MAXSIZE (1 << 20)
    #define isdigit(x) (x >= '0' && x <= '9')
    char buf[MAXSIZE], *p1, *p2;
    char pbuf[MAXSIZE], *pp;
    #if DEBUG
    #else
    IO() : p1(buf), p2(buf), pp(pbuf) {}
    ~IO() {fwrite(pbuf, 1, pp - pbuf, stdout);}
    #endif
    #define gc() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin), p1 == p2) ? ' ' : *p1++)
    #define blank(x) (x == ' ' || x == '\n' || x == '\r' || x == '\t')

    template <typename T>
    void Read(T &x)
    {
        #if DEBUG
        std::cin >> x;
        #else
        bool sign = 0; char ch = gc(); x = 0;
        for (; !isdigit(ch); ch = gc())
            if (ch == '-') sign = 1;
        for (; isdigit(ch); ch = gc()) x = x * 10 + (ch ^ 48);
        if (sign) x = -x;
        #endif
    }
    void Read(char *s)
    {
        #if DEBUG
        std::cin >> s;
        #else
        char ch = gc();
        for (; blank(ch); ch = gc());
        for (; !blank(ch); ch = gc()) *s++ = ch;
        *s = 0;
        #endif
    }
    void Read(char &c) {for (c = gc(); blank(c); c = gc());}

    void Push(const char &c)
    {
        #if DEBUG
        putchar(c);
        #else
        if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
        *pp++ = c;
        #endif
    }
    template <typename T>
    void Write(T x)
    {
        if (x < 0) x = -x, Push('-');
        static T sta[35];
        int top = 0;
        do sta[top++] = x % 10, x /= 10; while (x);
        while (top) Push(sta[--top] ^ 48);
    }
    template <typename T>
    void Write(T x, char lst) {Write(x), Push(lst);}
} IO;
#define Read(x) IO.Read(x)
#define Write(x, y) IO.Write(x, y)
#define Put(x) IO.Push(x)

using namespace std;

const int MAXN = 2e5 + 10;

int n, m;
char s[MAXN], t[4];
int cnt0, cnt1;

inline void Flip()
{
    for (int i = 1; i <= n; i++) s[i] = (s[i] == '0' ? '1' : '0');
    for (int i = 1; i <= m; i++) t[i] = (t[i] == '0' ? '1' : '0');
}

inline void Solution1()
{
    bool flag = 1;
    for (int i = 1; i <= n; i++)
        if (s[i] == '0') {flag = 0; break;}
    if (flag) cout << "0\n";
    else cout << "-1\n";
}

inline void Solution2_1()
{
    if (cnt0 > cnt1 + 1) return cout << "-1\n", void();
    int ans = 0;
    for (int i = 1; i < n; i++)
        if (s[i] == '0' && s[i + 1] == '0') ans++;
    cout << ans << "\n";
}

inline void Solution2_2()
{
    int ans = 0;
    for (int i = 2; i <= n; i++)
        if (s[i - 1] == '0' && s[i] == '1') ans++;
    cout << ans << "\n";
}

int a[MAXN], top;

inline void Solution3_1()
{
    if (cnt0 > cnt1 * 2 + 2) return cout << "-1\n", void();
    int sum = 0, ans = 0;
    for (int i = 1; i <= n; i++)
        if (s[i] == '1') a[++top] = sum, sum = 0;
        else sum++;
    if (sum) a[++top] = sum;
    int cnt = 0;
    for (int i = 1; i <= top; i++) cnt += (a[i] == 1);
    int x = min(cnt, 2 * cnt1 - cnt0 + 2), t = 0;
    for (int i = 1; i <= top; i++)
        if (a[i] != 1) a[++t] = a[i];
        else if (x) x--;
        else a[++t] = a[i];
    int pre = 0;
    // for (int i = 1; i <= t; i++) cout << a[i] << " "; cout << "\n";
    for (int i = 1; i <= t; i++)
        if (a[i] & 1)
        {
            if (pre) ans += (pre + a[i] - 2) / 2, pre = 0;
            else pre = a[i];
        }
        else if (a[i]) ans += a[i] / 2 - 1;
    if (pre) ans += pre / 2;
    cout << ans << "\n";
    // if (cnt0 == cnt1 * 2 + 2)
    // {
    //     int sum = 0, ans = 0, cnt = 0;
    //     for (int i = 1; i <= n; i++)
    //         if (s[i] == '1')
    //         {
    //             if (!sum) continue;
    //             if (sum & 1) cnt++, ans += sum - 1;
    //             else ans += sum;
    //             sum = 0;
    //         }
    //         else sum++;
    //     cout << cnt / 2 + ans / 2 << "\n";
    //     // int sum = 0, ans = 0;
    //     // for (int i = 1; i <= n; i++)
    //     // {
    //     //     if (s[i] == '0')
    //     //     {
    //     //         if (sum == 1) str[++top] = '0', sum = 0;
    //     //         else sum++;
    //     //     }
    //     //     else
    //     //     {
    //     //         if (sum == 0) str[++top] = '1';
    //     //         else
    //     //         {
    //     //             int j = i;
    //     //             while (s[j + 1] == '1') j++;
    //     //             if (!top || str[top] == '1')
    //     //             {
    //     //                 str[++top] = '0';
    //     //                 for (int k = i; k <= j; k++) str[++top] = '1';
    //     //             }
    //     //             else
    //     //             {
    //     //                 for (int k = i; k <= j; k++) str[++top] = '1';
    //     //                 str[++top] = '0';
    //     //             }
    //     //             ans++, sum = 0, i = j + 1;
    //     //         }
    //     //     }
    //     // }
    //     // // for (int i = 1; i <= top; i++) cout << str[i]; cout << "\n";
    //     // for (int i = 1; i < top; i++)
    //     //     if (str[i] == '0' && str[i + 1] == '0') ans++;
    //     // cout << ans << "\n";
    // }
    // else
    // {
    //     int ans = 0;
    //     for (int i = 3; i <= n; i++)
    //         if (s[i - 2] == '0' && s[i - 1] == '0' && s[i] == '0') ans++, i++;
    //     cout << ans << "\n";
    // }
    // int res = 0, sum = 0;
    // for (int i = 2; i <= n; i++)
    // {
    //     if (i == 2 && s[1] == '0' && s[2] == '1') res++;
    //     if (i == 3 && s[1] == '0' && s[2] == '0' && s[3] == '1') sum++;
    //     if (i == n && s[i - 1] == '1' && s[i] == '0') res++;
    //     if (i == n && s[i - 2] == '1' && s[i - 1] == '0' && s[i] == '0') sum++;
    //     if (i > 2 && s[i - 2] == '1' && s[i - 1] == '0' && s[i] == '1') res++;
    //     if (i > 3 && s[i - 3] == '1' && s[i - 2] == '0' && s[i - 1] == '0' && s[i] == '1') sum++;
    // }
    // cnt0 -= sum * 2, cnt1 -= sum;
    // if (cnt0 - res <= (cnt1 - res) * 2 + 2)
    // {
    //     int ans = 0;
    //     for (int i = 3; i <= n; i++)
    //         if (s[i - 2] == '0' && s[i - 1] == '0' && s[i] == '0') ans++, i++;
    //     cout << ans << "\n";
    // }
    // else
    // {
    //     int x = 2 * cnt1 - cnt0 + 2;
    //     cnt0 -= x, cnt1 -= x;
    //     cout << (cnt0 - 1) / 2 << "\n";
    // }
}

inline void Solution3_2()
{
    int ans = 0;
    for (int i = 2; i < n; i++)
        if (s[i - 1] == '0' && s[i] == '1' && s[i + 1] == '0')
            ans++;
    cout << (ans + 1) / 2 << "\n";
}

inline void Solution3_3()
{
    if (t[2] == '1') reverse(s + 1, s + n + 1), Flip();
    int ans = 0;
    for (int i = 3; i <= n; i++)
        if (s[i] == '1' && s[i - 1] == '0' && s[i - 2] == '0')
            ans++;
    cout << ans << "\n";
}

int main()
{
    // freopen("A.in", "r", stdin);
    // freopen("A.out", "w", stdout);
    #if DEBUG
    #else
    ios::sync_with_stdio(0), cin.tie(0);
    #endif
    Read(s + 1), Read(t + 1), n = strlen(s + 1), m = strlen(t + 1);
    if (n < m) return cout << "0\n", 0;
    if (t[1] == '1') Flip();
    for (int i = 1; i <= n; i++) cnt0 += (s[i] == '0'), cnt1 += (s[i] == '1');

    if (m == 1) Solution1();
    else if (m == 2 && t[1] == t[2]) Solution2_1();
    else if (m == 2) Solution2_2();
    else if (m == 3 && t[1] == t[2] && t[2] == t[3]) Solution3_1();
    else if (m == 3 && t[1] == t[3]) Solution3_2();
    else Solution3_3();
    return 0;
}

详细

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 1ms
memory: 5672kb

input:

1
0

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

1
1

output:

-1

result:

ok 1 number(s): "-1"

Test #3:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

-1

result:

ok 1 number(s): "-1"

Test #4:

score: 0
Accepted
time: 1ms
memory: 5624kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

0

result:

ok 1 number(s): "0"

Test #5:

score: 0
Accepted
time: 1ms
memory: 3976kb

input:

101001000011101010101001001010010110111111001100110001111101111110110110101011111010001101111001101101010111101100000110001110001100000101111100000110111110001010101101101110001000011010000101000110110010110110100001110001111001010000000010000000101000000100110011101110100111111101111111111110010101...

output:

-1

result:

ok 1 number(s): "-1"

Test #6:

score: 0
Accepted
time: 1ms
memory: 3940kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #7:

score: 0
Accepted
time: 1ms
memory: 3944kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

-1

result:

ok 1 number(s): "-1"

Subtask #2:

score: 3
Accepted

Test #8:

score: 3
Accepted
time: 0ms
memory: 3652kb

input:

0
01

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3680kb

input:

0
10

output:

0

result:

ok 1 number(s): "0"

Test #10:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

01
01

output:

1

result:

ok 1 number(s): "1"

Test #11:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

01
10

output:

0

result:

ok 1 number(s): "0"

Test #12:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

1010101010
10

output:

5

result:

ok 1 number(s): "5"

Test #13:

score: 0
Accepted
time: 1ms
memory: 5648kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #14:

score: 0
Accepted
time: 1ms
memory: 3980kb

input:

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #15:

score: 0
Accepted
time: 1ms
memory: 4112kb

input:

010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...

output:

100000

result:

ok 1 number(s): "100000"

Test #16:

score: 0
Accepted
time: 0ms
memory: 3928kb

input:

000110111001011000010001010010010000010100100000011101010000001000110011100000011011100101110110000001000000000011001010001101001110011111001101110010001100000000010000000100100011000111010011100110011101100011000100011001010000010001001010010101100000100000010010110000000001011100100001000010100100...

output:

43860

result:

ok 1 number(s): "43860"

Test #17:

score: 0
Accepted
time: 0ms
memory: 4040kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

44072

result:

ok 1 number(s): "44072"

Subtask #3:

score: 4
Accepted

Dependency #2:

100%
Accepted

Test #18:

score: 4
Accepted
time: 1ms
memory: 5656kb

input:

0
01

output:

0

result:

ok 1 number(s): "0"

Test #19:

score: 0
Accepted
time: 1ms
memory: 5604kb

input:

0
10

output:

0

result:

ok 1 number(s): "0"

Test #20:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

01
01

output:

1

result:

ok 1 number(s): "1"

Test #21:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

01
10

output:

0

result:

ok 1 number(s): "0"

Test #22:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

1
00

output:

0

result:

ok 1 number(s): "0"

Test #23:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

1
11

output:

0

result:

ok 1 number(s): "0"

Test #24:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

10
00

output:

0

result:

ok 1 number(s): "0"

Test #25:

score: 0
Accepted
time: 1ms
memory: 5700kb

input:

11
11

output:

-1

result:

ok 1 number(s): "-1"

Test #26:

score: 0
Accepted
time: 1ms
memory: 5688kb

input:

1010101010
10

output:

5

result:

ok 1 number(s): "5"

Test #27:

score: 0
Accepted
time: 1ms
memory: 3976kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #28:

score: 0
Accepted
time: 1ms
memory: 4008kb

input:

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #29:

score: 0
Accepted
time: 1ms
memory: 5620kb

input:

010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...

output:

100000

result:

ok 1 number(s): "100000"

Test #30:

score: 0
Accepted
time: 2ms
memory: 5836kb

input:

001000001110000110101100000001110000011000100001010001110010010101110110111000000000100000010110100000101110001000001010000000010101000010001000100010111010000110000001000001100110001010000010000101001001110100000011001000100100100101000101000100000100001001000000111000100101010010101100101001001010...

output:

43612

result:

ok 1 number(s): "43612"

Test #31:

score: 0
Accepted
time: 2ms
memory: 5696kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

43815

result:

ok 1 number(s): "43815"

Test #32:

score: 0
Accepted
time: 1ms
memory: 5760kb

input:

0011001101
00

output:

2

result:

ok 1 number(s): "2"

Test #33:

score: 0
Accepted
time: 0ms
memory: 4076kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

1

result:

ok 1 number(s): "1"

Test #34:

score: 0
Accepted
time: 2ms
memory: 4052kb

input:

011110101001110000100100101010111010100110011010001001000110011111010101111000110100000110010011001010111001000110000110001110110100011111100010111010101101001100101110100001101111110110000100110110111001000001101110011010100110000111101101101111011000110010100100100001000011010100000100110101001000...

output:

50001

result:

ok 1 number(s): "50001"

Test #35:

score: 0
Accepted
time: 1ms
memory: 3976kb

input:

111011011000111010010001101100000110011000000101110011111110010110001010001000011100011100101011110101101001011101010011110100011101111111000011110101010001000011000100110001011110100010111101111110011001010110011001110111001011000000110100000011001110110110000101010100001001110100111010100100100101...

output:

-1

result:

ok 1 number(s): "-1"

Test #36:

score: 0
Accepted
time: 1ms
memory: 4004kb

input:

110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110...

output:

50000

result:

ok 1 number(s): "50000"

Test #37:

score: 0
Accepted
time: 1ms
memory: 4052kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

99999

result:

ok 1 number(s): "99999"

Test #38:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

000100100001010000001000011101100101000000000000100000101000100110111001000100000000001000100011101100010010100100000011110101010010010001000001000010000011101000011101010010000110000001000000010100001100010011001001010100010001010000001101101001010110011001000001110000001100010001000101000010110000...

output:

24091

result:

ok 1 number(s): "24091"

Test #39:

score: 0
Accepted
time: 2ms
memory: 4000kb

input:

011000011010000110001000000000100110011001001101011100010010100000100011010110010010011101100000011100110100001010000000100010011100001010010100000100000000100010010101110000001000001010111001100001001011101011110011100101110110101010110000100010001110111010111010000000101111010001010000001111111001...

output:

58668

result:

ok 1 number(s): "58668"

Subtask #4:

score: 5
Accepted

Test #40:

score: 5
Accepted
time: 0ms
memory: 3568kb

input:

11
011

output:

0

result:

ok 1 number(s): "0"

Test #41:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

0
110

output:

0

result:

ok 1 number(s): "0"

Test #42:

score: 0
Accepted
time: 1ms
memory: 5576kb

input:

01
100

output:

0

result:

ok 1 number(s): "0"

Test #43:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

110
110

output:

1

result:

ok 1 number(s): "1"

Test #44:

score: 0
Accepted
time: 1ms
memory: 5596kb

input:

010
001

output:

0

result:

ok 1 number(s): "0"

Test #45:

score: 0
Accepted
time: 1ms
memory: 5660kb

input:

001001001001
001

output:

4

result:

ok 1 number(s): "4"

Test #46:

score: 0
Accepted
time: 1ms
memory: 3984kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #47:

score: 0
Accepted
time: 2ms
memory: 5652kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

0

result:

ok 1 number(s): "0"

Test #48:

score: 0
Accepted
time: 1ms
memory: 3956kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

24856

result:

ok 1 number(s): "24856"

Test #49:

score: 0
Accepted
time: 2ms
memory: 5720kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

0

result:

ok 1 number(s): "0"

Test #50:

score: 0
Accepted
time: 1ms
memory: 3996kb

input:

010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010...

output:

62521

result:

ok 1 number(s): "62521"

Test #51:

score: 0
Accepted
time: 0ms
memory: 5604kb

input:

011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011...

output:

66666

result:

ok 1 number(s): "66666"

Test #52:

score: 0
Accepted
time: 2ms
memory: 5608kb

input:

110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110...

output:

66666

result:

ok 1 number(s): "66666"

Subtask #5:

score: 5
Accepted

Test #53:

score: 5
Accepted
time: 1ms
memory: 3664kb

input:

11
011

output:

0

result:

ok 1 number(s): "0"

Test #54:

score: 0
Accepted
time: 0ms
memory: 5756kb

input:

01
100

output:

0

result:

ok 1 number(s): "0"

Test #55:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

011
011

output:

1

result:

ok 1 number(s): "1"

Test #56:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

010
100

output:

0

result:

ok 1 number(s): "0"

Test #57:

score: 0
Accepted
time: 1ms
memory: 5596kb

input:

0
010

output:

0

result:

ok 1 number(s): "0"

Test #58:

score: 0
Accepted
time: 1ms
memory: 5756kb

input:

10
101

output:

0

result:

ok 1 number(s): "0"

Test #59:

score: 0
Accepted
time: 1ms
memory: 5760kb

input:

010
010

output:

1

result:

ok 1 number(s): "1"

Test #60:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

000
101

output:

0

result:

ok 1 number(s): "0"

Test #61:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

001001001001
100

output:

3

result:

ok 1 number(s): "3"

Test #62:

score: 0
Accepted
time: 1ms
memory: 3992kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #63:

score: 0
Accepted
time: 1ms
memory: 4108kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

0

result:

ok 1 number(s): "0"

Test #64:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

25010

result:

ok 1 number(s): "25010"

Test #65:

score: 0
Accepted
time: 1ms
memory: 4052kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

0

result:

ok 1 number(s): "0"

Test #66:

score: 0
Accepted
time: 1ms
memory: 5700kb

input:

110001101111100110100110010110111101001001110110101110011010011000101000011001110011100111110111100001111111101011001001010111001100001001000001010000100010001001010101000101100011110110001100101110101101001100011101110111011110000111111110110110001001001100110110111001010001111111101100111011111011...

output:

62502

result:

ok 1 number(s): "62502"

Test #67:

score: 0
Accepted
time: 2ms
memory: 5836kb

input:

011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011...

output:

66666

result:

ok 1 number(s): "66666"

Test #68:

score: 0
Accepted
time: 2ms
memory: 5604kb

input:

110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110...

output:

66666

result:

ok 1 number(s): "66666"

Test #69:

score: 0
Accepted
time: 2ms
memory: 3988kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

11173

result:

ok 1 number(s): "11173"

Test #70:

score: 0
Accepted
time: 0ms
memory: 5584kb

input:

101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101...

output:

33333

result:

ok 1 number(s): "33333"

Test #71:

score: 0
Accepted
time: 2ms
memory: 4008kb

input:

011011011000000110101011001010010101000100000000110110100011001001010001001100110100001000101001100000001100101000001111010100001001010011000000101000110110100010001110110111101010010000110110000000100000101000100100000000010111101000011000010010100011000000010001000000000110101000010010010000011000...

output:

7665

result:

ok 1 number(s): "7665"

Test #72:

score: 0
Accepted
time: 2ms
memory: 5932kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #73:

score: 0
Accepted
time: 1ms
memory: 4052kb

input:

010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...

output:

50000

result:

ok 1 number(s): "50000"

Test #74:

score: 0
Accepted
time: 1ms
memory: 5656kb

input:

010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010...

output:

0

result:

ok 1 number(s): "0"

Subtask #6:

score: 0
Wrong Answer

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #75:

score: 7
Accepted
time: 1ms
memory: 5632kb

input:

111
111

output:

-1

result:

ok 1 number(s): "-1"

Test #76:

score: 0
Accepted
time: 0ms
memory: 5652kb

input:

000001111000
000

output:

3

result:

ok 1 number(s): "3"

Test #77:

score: 0
Accepted
time: 2ms
memory: 5964kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #78:

score: -7
Wrong Answer
time: 0ms
memory: 5960kb

input:

001001001100001001010101000100000101111110000100001100100100010000010101000011011001010001101000011000000100010000101000110000100001001001001000100000011100011000000101100100111110010001100010000000000000000001000000000011010000001000101000100111000011011110101010101001001010101001100011011000001010...

output:

35565

result:

wrong answer 1st numbers differ - expected: '37010', found: '35565'