QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#124226#6667. Prosjekbashkort#0 211ms6720kbC++20758b2023-07-14 13:59:192024-07-04 00:39:32

Judging History

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

  • [2024-07-04 00:39:32]
  • 评测
  • 测评结果:0
  • 用时:211ms
  • 内存:6720kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-14 13:59:19]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

    int test = 1;
    cin >> test;

    while (test--) {
        int n;
        cin >> n;

        vector<ll> a(n);

        for (int i = 0; i < n; ++i) {
            cin >> a[i];
        }

        stable_partition(a.begin(), a.end(), [&](ll x) { return x % 2 == 0; });

        if (a[n - 1] % 2 == 1 && a[n - 2] % 2 == 0) {
            cout << "-1\n";
            continue;
        }
        
        while (size(a) > 1) {
            cout << a.back() << " " << a.end()[-2] << '\n';
            a.end()[-2] += a.back();
            a.pop_back();
        }
    }

    return 0;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3620kb

input:

99
4
739880851158065302 19206582949872932 883064254701115295 222072661880779376
7
148399819461615003 209088712310207988 53191076581680214 445068618251612752 230505279594622109 115754892157516718 804173775829453588
2
77979357045500669 41693388829622019
3
341612949433488278 609808714829036935 19994167...

output:

-1
230505279594622109 148399819461615003
378905099056237112 804173775829453588
1183078874885690700 115754892157516718
1298833767043207418 445068618251612752
1743902385294820170 53191076581680214
1797093461876500384 209088712310207988
41693388829622019 77979357045500669
-1
-1
663876810271466345 99030...

result:

wrong answer you didn't find a solution but jury did (test case 1)

Subtask #2:

score: 0
Wrong Answer

Test #16:

score: 0
Wrong Answer
time: 0ms
memory: 3784kb

input:

100
3
3 3 2
3
4 1 1
4
1 3 4 4
6
4 4 2 3 1 2
4
0 2 1 4
3
0 2 0
7
3 3 1 1 3 4 0
2
0 4
4
1 4 2 3
7
4 0 0 3 2 3 4
4
4 2 0 3
7
0 2 2 1 4 2 4
7
3 0 3 1 2 0 3
4
4 3 1 4
6
2 3 0 1 3 4
5
1 4 0 3 4
5
4 2 0 4 2
3
0 1 2
6
4 1 4 2 0 4
7
4 2 4 3 1 3 1
4
1 4 4 0
2
1 1
6
0 3 3 0 0 4
7
4 3 0 3 3 3 4
4
4 1 1 3
6
2 0 ...

output:

3 3
6 2
1 1
2 4
3 1
4 4
8 4
1 3
4 2
6 2
8 4
12 4
-1
0 2
2 0
3 1
4 1
5 3
8 3
11 0
11 4
4 0
3 1
4 2
6 4
3 3
6 4
10 2
12 0
12 0
12 4
-1
-1
3 1
4 3
7 3
10 0
10 2
12 0
1 3
4 4
8 4
3 1
4 3
7 4
11 0
11 2
3 1
4 4
8 0
8 4
2 4
6 0
6 2
8 4
-1
-1
1 3
4 1
5 3
8 4
12 2
14 4
-1
1 1
3 3
6 4
10 0
10 0
10 0
3 3
6 3
9...

result:

wrong answer there's no 6 in the current set (test case 1)

Subtask #3:

score: 0
Wrong Answer

Test #34:

score: 0
Wrong Answer
time: 110ms
memory: 3556kb

input:

100000
5
846784256447769304 457696478728961702 128469521648960690 597630796847754190 104256763714529164
5
658897822238868978 472135077337628566 399538027669313322 622703684108675696 425723088635325654
5
917704960887390986 140817562615382054 877934664521057998 782212806618666818 616380973421914538
8
...

output:

104256763714529164 597630796847754190
701887560562283354 128469521648960690
830357082211244044 457696478728961702
1288053560940205746 846784256447769304
425723088635325654 622703684108675696
1048426772744001350 399538027669313322
1447964800413314672 472135077337628566
1920099877750943238 65889782223...

result:

wrong answer Integer 1288053560940205746 violates the range [0, 10^18] (test case 1)

Subtask #4:

score: 0
Wrong Answer

Test #46:

score: 0
Wrong Answer
time: 211ms
memory: 6720kb

input:

100
211957
911918942087402387 344230223346742784 16289402153237664 528890583619159010 886281719684850237 865484734102017297 321851390502278959 754268375474197153 237414161302130571 135637002716682378 824412491959977735 162505521049217610 246319278060116103 666703181591704279 650875500699154233 96397...

output:

532418085391726079 759554573156793027
1291972658548519106 553185893931599463
1845158552480118569 591082823267833997
2436241375747952566 750673279799819289
3186914655547771855 708237805751519827
3895152461299291682 274990826677686423
4170143287976978105 749387671911821385
4919530959888799490 59630014...

result:

wrong answer Integer 1291972658548519106 violates the range [0, 10^18] (test case 1)