QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#187173#6718. Масив i частковi сумиCyanmond57 12ms7844kbC++172.8kb2023-09-24 15:07:322023-09-24 15:07:33

Judging History

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

  • [2023-09-24 15:07:33]
  • 评测
  • 测评结果:57
  • 用时:12ms
  • 内存:7844kb
  • [2023-09-24 15:07:32]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define rep(i, l, r) for (int i = (l); i < (r); ++i)
#define per(i, l, r) for (int i = (r - 1); i >= l; --i)
#define ALL(x) (x).begin(), (x).end()

using i64 = long long;

void main_() {
    int N, G;
    cin >> N >> G;
    vector<i64> A(N);
    for (auto &e : A) cin >> e;
    if (G == 1) {
        if (all_of(ALL(A), [](i64 v) { return v >= 0; })) {
            cout << 0 << endl;
        } else if (all_of(ALL(A), [](i64 v) { return v <= 0; })) {
            cout << 1 << '\n' << 1 << endl;
        } else {
            vector<i64> B(N), C(N);
            rep(i, 0, N) {
                B[i] = (i == 0 ? 0 : B[i - 1]) + A[i];
            }
            per(i, 0, N) {
                C[i] = (i == N - 1 ? 0 : C[i + 1]) + A[i];
            }
            if (all_of(ALL(B), [](i64 v) { return v >= 0; })) {
                cout << 1 << '\n' << 2 << ' ' << 1 << ' ' << N << endl;
            } else {
                cout << 1 << '\n' << 3 << ' ' << 1 << ' ' << N << endl;
            }
        }
        return;
    }
    if (G == 2) {
        i64 f = 0;
        for (const auto e : A) {
            if (e != 0) {
                f = e;
                break;
            }
        }
        if (f == 0) {
            cout << 0 << endl;
        } else {
            if (f == 1) {
                cout << 100 << endl;
                rep(i, 0, 100) cout << 2 << ' ' << 1 << ' ' << N << endl;
            } else {
                cout << 100 << endl;
                rep(i, 0, 99) cout << 2 << ' ' << 1 << ' ' << N << endl;
                cout << 1 << endl;
            }
        }
        return;
    }
    if (G == 5 or G == 6) {
        vector<pair<int, int>> ans;
        while (any_of(ALL(A), [](i64 x) { return x < 0; })) {
            __int128_t sum = 0;
            int r = N - 1;
            rep(i, 0, N) {
                sum += A[i];
                if (sum < A[i]) {
                    r = i - 1;
                    break;
                } else {
                    A[i] = sum;
                }
            }
            ans.push_back({0, r});
        }
        cout << ans.size() << endl;
        for (const auto &[a, b] : ans) cout << 2 << ' ' << a + 1 << ' ' << b + 1 << endl;
        return;
    }

    auto sol = [&]() -> vector<tuple<int, int, int>> {
        auto B = A;
        
    };

    const auto X = sol();
    for (auto &e : A) e = -e;
    auto Y = sol();
    Y.insert(Y.begin(), {1, 0, 0});
    auto ans = X.size() < Y.size() ? X : Y;

    cout << ans.size() << endl;
    for (const auto &[t, l, r] : ans) {
        cout << t;
        if (t == 1) cout << endl;
        else cout << ' ' << l << ' ' << r << endl;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    main_();
}

詳細信息

Subtask #1:

score: 14
Accepted

Test #1:

score: 14
Accepted
time: 8ms
memory: 4592kb

input:

200000 1
1 1 0 0 1 0 1 0 0 0 0 1 1 0 1 0 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 0 0 1 0 0 1 1 0 1 0 0 1 0 0 0 0 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 1 1 1 1 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 0...

output:

0

result:

ok OK: 0 operations

Test #2:

score: 0
Accepted
time: 10ms
memory: 4520kb

input:

200000 1
-1 0 0 0 -1 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 -1 -1 0 -1 -1 0 0 0 -1 -1 0 -1 0 -1 0 -1 0 -1 -1 0 0 -1 -1 0 0 -1 -1 0 -1 -1 -1 -1 0 -1 -1 0 0 0 -1 0 -1 -1 -1 0 -1 -1 0 0 0 -1 -1 -1 -1 -1 0 0 -1 -1 0 -1 0 -1 0 -1 -1 -1 0 -1 -1 0 0 0 0 -1 -1 -1 0 0 -1 -1 -1 0 0 -1 -1 -1 0 0 -1 -1 -1 0 -...

output:

1
1

result:

ok OK: 1 operations

Test #3:

score: 0
Accepted
time: 12ms
memory: 7752kb

input:

200000 1
0 0 1 -1 1 1 -1 -1 0 1 -1 0 0 1 0 0 1 1 1 1 0 -1 -1 0 -1 -1 1 -1 1 1 1 1 -1 1 -1 1 1 0 -1 -1 0 1 0 0 0 0 1 1 -1 0 0 -1 -1 -1 0 0 0 1 1 1 -1 1 1 0 0 1 1 -1 1 0 0 1 1 1 1 -1 0 1 0 0 0 0 1 0 0 -1 0 -1 1 -1 0 1 -1 -1 0 0 0 -1 0 0 1 1 1 0 -1 0 1 1 1 0 1 0 0 0 -1 -1 0 -1 -1 1 -1 -1 1 1 0 1 1 1 -1...

output:

1
2 1 200000

result:

ok OK: 1 operations

Test #4:

score: 0
Accepted
time: 8ms
memory: 7844kb

input:

200000 1
-1 -1 -1 -1 0 1 0 -1 -1 0 -1 -1 1 0 0 -1 0 1 -1 0 -1 1 -1 0 1 1 0 1 1 1 0 0 1 -1 0 1 0 0 0 0 1 1 1 1 1 0 1 -1 1 1 0 -1 0 1 0 0 0 1 1 0 1 0 -1 -1 0 0 -1 -1 0 1 -1 -1 -1 0 1 0 0 -1 0 1 0 1 1 1 1 0 1 -1 -1 -1 0 0 0 -1 1 1 -1 -1 -1 1 0 0 -1 -1 0 -1 -1 -1 0 1 1 1 1 0 1 -1 -1 0 -1 0 0 0 -1 -1 -1 ...

output:

1
3 1 200000

result:

ok OK: 1 operations

Subtask #2:

score: 17
Accepted

Test #5:

score: 17
Accepted
time: 8ms
memory: 4624kb

input:

200000 2
1 1 0 0 1 0 1 0 1 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 0 0 0 0 0 1 1 0 1 1 0 1 0 1 0 1 1 1 0 0 1 0 0 1 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 0...

output:

100
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000...

result:

ok OK: 100 operations

Test #6:

score: 0
Accepted
time: 6ms
memory: 4600kb

input:

200000 2
0 0 -1 -1 0 -1 0 0 -1 -1 0 -1 -1 0 -1 0 -1 -1 -1 -1 -1 0 0 -1 0 -1 -1 0 0 -1 -1 -1 -1 -1 -1 -1 -1 0 0 -1 -1 0 -1 -1 -1 0 -1 0 -1 0 -1 0 0 0 0 0 0 0 0 0 0 -1 0 -1 0 -1 0 0 0 -1 -1 0 0 -1 -1 -1 0 -1 -1 0 -1 -1 -1 -1 0 -1 -1 -1 0 0 -1 0 0 0 -1 -1 -1 0 0 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 0 0 0 -1 -1...

output:

100
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000...

result:

ok OK: 100 operations

Test #7:

score: 0
Accepted
time: 8ms
memory: 4608kb

input:

200000 2
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

100
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000...

result:

ok OK: 100 operations

Test #8:

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

input:

200000 2
1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

output:

100
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000...

result:

ok OK: 100 operations

Test #9:

score: 0
Accepted
time: 8ms
memory: 4596kb

input:

200000 2
1 1 0 0 1 0 0 0 0 0 0 0 1 0 0 -1 0 0 0 0 -1 0 -1 0 -1 0 0 0 0 -1 0 0 0 -1 0 0 0 -1 0 -1 0 0 0 0 0 0 0 -1 -1 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 -1 0 -1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 -1 0 0 0 0 -1 0 0 0 1 0 0 -1 0 -1 0 0 0 0 0 -1 0 0 0 -1 -1 0 0 0 -1 0 -1 0 0 0 0 0 0 ...

output:

100
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000...

result:

ok OK: 100 operations

Test #10:

score: 0
Accepted
time: 9ms
memory: 4560kb

input:

200000 2
-1 0 1 -1 0 1 1 0 1 0 0 1 0 1 -1 1 1 -1 1 -1 -1 0 -1 -1 0 -1 0 0 0 1 1 0 -1 1 -1 0 1 0 1 -1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 0 1 -1 0 -1 1 -1 0 -1 1 -1 0 1 1 1 0 -1 0 -1 -1 -1 -1 0 0 -1 1 -1 -1 0 1 -1 0 0 0 0 0 0 1 1 1 0 -1 0 -1 1 -1 1 -1 1 1 0 0 1 1 -1 1 1 -1 -1 1 0 -1 1 -1 0 0 0 -1 0 0 1 1 -1 ...

output:

100
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000
2 1 200000...

result:

ok OK: 100 operations

Subtask #3:

score: 0
Runtime Error

Dependency #2:

100%
Accepted

Test #11:

score: 0
Runtime Error

input:

200000 3
0 1 1 0 0 1 0 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 0 1 1 1 0 0 0 0 1 1 0 1 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 1 1 0 0 1 0 0 0 0 1 1 0 1 0 0 1 1 0 1 0 1 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 0 0 0 1 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 0...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 7
Accepted

Test #28:

score: 7
Accepted
time: 0ms
memory: 3532kb

input:

2891 5
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 ...

output:

2
2 1 139
2 1 2891

result:

ok OK: 2 operations

Test #29:

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

input:

2847 5
1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 0 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

output:

2
2 1 135
2 1 2847

result:

ok OK: 2 operations

Test #30:

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

input:

2981 5
1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

output:

2
2 1 139
2 1 2981

result:

ok OK: 2 operations

Test #31:

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

input:

3000 5
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

2
2 1 1507
2 1 3000

result:

ok OK: 2 operations

Test #32:

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

input:

3000 5
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

2
2 1 1507
2 1 3000

result:

ok OK: 2 operations

Subtask #6:

score: 19
Accepted

Dependency #5:

100%
Accepted

Test #33:

score: 19
Accepted
time: 8ms
memory: 4624kb

input:

191855 6
1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1...

output:

2
2 1 1124
2 1 191855

result:

ok OK: 2 operations

Test #34:

score: 0
Accepted
time: 9ms
memory: 4660kb

input:

191982 6
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1...

output:

2
2 1 1136
2 1 191982

result:

ok OK: 2 operations

Test #35:

score: 0
Accepted
time: 8ms
memory: 4600kb

input:

193538 6
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0...

output:

2
2 1 1127
2 1 193538

result:

ok OK: 2 operations

Test #36:

score: 0
Accepted
time: 8ms
memory: 4624kb

input:

200000 6
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

2
2 1 100007
2 1 200000

result:

ok OK: 2 operations

Test #37:

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

input:

200000 6
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

2
2 1 100007
2 1 200000

result:

ok OK: 2 operations

Subtask #7:

score: 0
Runtime Error

Dependency #5:

100%
Accepted

Test #38:

score: 0
Runtime Error

input:

3000 7
1 0 1 0 1 1 0 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 0 0 0 1 1 1 1 1 0 1 0 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 1 1 1 0 0 1 1 0 0 1 1 0...

output:


result:


Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%