QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#707190#6569. Splitting Pairsucup-team902#WA 1ms3612kbC++23807b2024-11-03 15:03:222024-11-03 15:03:25

Judging History

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

  • [2024-11-03 15:03:25]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3612kb
  • [2024-11-03 15:03:22]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
void solve() {
    int n;
    cin >> n;
    vector<long long> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    if (n % 2 == 0) {
        for (int i = 0; i < n; ++i) {
            if (a[i] % 2 == 0) {
                cout << 1 << '\n';
                return;
            }
        }
        cout << 0 << '\n';
        return;
    } else {
        for (int i = 1; i < n; ++i) {
            if (a[i] % 2 != a[0] % 2) {
                cout << 1 << '\n';
                return;
            }
        }
        cout << 0 << '\n';
        return;
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T = 1;
    cin >> T;
    while (T--) {
        solve();
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3604kb

input:

4
3
1 1 1
3
1 1 2
3
2 2 2
4
4 4 4 4

output:

0
1
0
1

result:

ok 4 lines

Test #2:

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

input:

1000
10
16 16 16 16 16 16 16 16 16 16
10
16 16 16 16 16 16 16 16 17 16
10
16 16 16 16 16 16 16 18 16 16
10
16 16 16 19 16 16 16 16 16 16
10
16 16 16 16 20 16 16 16 16 16
10
17 16 16 16 17 16 16 16 16 16
10
16 16 16 16 16 16 16 16 18 17
10
16 16 19 16 16 16 16 17 16 16
10
17 16 16 16 16 16 16 20 16 1...

output:

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
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
...

result:

ok 1000 lines

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3612kb

input:

1000
2
4 4
2
5 4
2
4 6
2
7 4
2
4 8
2
5 5
2
6 5
2
7 5
2
8 5
2
6 6
2
7 6
2
8 6
2
7 7
2
7 8
2
8 8
3
4 4 4
3
4 5 4
3
4 4 6
3
4 7 4
3
8 4 4
3
4 5 5
3
6 4 5
3
4 5 7
3
8 5 4
3
6 4 6
3
7 4 6
3
8 4 6
3
4 7 7
3
7 8 4
3
8 8 4
3
5 5 5
3
5 6 5
3
5 5 7
3
5 8 5
3
6 5 6
3
6 7 5
3
6 5 8
3
7 7 5
3
8 5 7
3
5 8 8
3
6 6...

output:

1
1
1
1
1
0
1
0
1
1
1
1
0
1
1
0
1
0
1
0
1
1
1
1
0
1
0
1
1
0
0
1
0
1
1
1
1
0
1
1
0
1
0
1
1
0
0
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
0
1
0
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
0
1
1
1
1
0
1
0
1
0
1
1
1
1
0
1
0
1
1
0
1
1
1
1
1
1
1
1
1
1
0
1
0
1
1
...

result:

wrong answer 18th lines differ - expected: '1', found: '0'