CSES - Putka Open 2020 – 2/5 - Results
Submission details
Task:Summat
Sender:Guuber
Submission time:2020-09-26 13:26:12 +0300
Language:C++11
Status:READY
Result:12
Feedback
groupverdictscore
#1ACCEPTED12
#20
#30
Test results
testverdicttimegroup
#1ACCEPTED0.01 s1, 2, 3details
#2ACCEPTED0.01 s1, 2, 3details
#3ACCEPTED0.01 s1, 2, 3details
#4ACCEPTED0.01 s1, 2, 3details
#5ACCEPTED0.01 s1, 2, 3details
#60.01 s2, 3details
#70.01 s2, 3details
#80.01 s2, 3details
#90.01 s2, 3details
#100.01 s2, 3details
#110.01 s3details
#120.01 s3details
#130.01 s3details
#140.01 s3details
#150.01 s3details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:36:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         for(int i = 0; i < ve.size(); i++){
                                        ~~^~~~~~~~~~~
input/code.cpp:43:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         for(int i = 0; i < su.size(); i++){
                                        ~~^~~~~~~~~~~

Code

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> lop = {};
    for(int i = 0; i < (n*(n-1))/2; i++){
        int a;
        cin >> a;
        lop.push_back(a);
    }
    bool bo = false;
    sort(lop.begin(), lop.end());
    for(int i1 = 1; i1 < 6; i1++){
        for(int i2 = 1; i2 < 6; i2++){
            for(int i3 = 1; i3 < 6; i3++){
                for(int i4 = 1; i4 < 6; i4++){
                    for(int i5 = 1; i5 < 6; i5++){
                        if(bo) break;
                        vector<int> ve = {};
                        if(n == 1){
                            ve = {i1};
                        }else if(n == 2){
                            ve = {i1, i2};
                        }else if(n == 3){
                            ve = {i1,i2,i3};
                        }else if(n == 4){
                            ve = {i1,i2,i3,i4};
                        }else if(n == 5){
                            ve = {i1,i2,i3,i4,i5};
                        }else{
                            cout << "RIP\n";
                        }
                        vector<int> su = {};
                        for(int i = 0; i < ve.size(); i++){
                            for(int j = 0; j < i; j++){
                                su.push_back(ve[i]+ve[j]);
                            }
                        }
                        sort(su.begin(), su.end());
                        bo = true;
                        for(int i = 0; i < su.size(); i++){
                            if(su[i] != lop[i]){ bo = false; }
                        }
                        if(bo){
                            for(auto u : ve) cout << u << " ";
                            cout << "\n";
                        }
                    }
                }
            }
        }
    }
}

Test details

Test 1

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
2 2 2 2 2 2 2 2 2 2

correct output
1 1 1 1 1 

user output
1 1 1 1 1 

Test 2

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
3 4 5 5 6 6 7 7 8 9

correct output
1 2 3 4 5 

user output
1 2 3 4 5 

Test 3

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
5 6 6 6 9 9 9 10 10 10

correct output
1 4 5 5 5 

user output
1 4 5 5 5 

Test 4

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
2 3 3 6 6 6 6 7 7 10

correct output
1 1 2 5 5 

user output
1 1 2 5 5 

Test 5

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
4 5 5 5 5 6 6 6 7 7

correct output
2 2 3 3 4 

user output
2 2 3 3 4 

Test 6

Group: 2, 3

Verdict:

input
20
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

correct output
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

user output
RIP

Test 7

Group: 2, 3

Verdict:

input
20
3 4 5 5 6 6 7 7 7 8 8 8 9 9 9 ...

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
RIP

Test 8

Group: 2, 3

Verdict:

input
20
52 55 55 57 62 62 63 64 66 71 ...

correct output
1 51 54 54 56 61 61 62 63 65 7...

user output
RIP

Test 9

Group: 2, 3

Verdict:

input
20
25 30 31 32 36 39 40 41 45 45 ...

correct output
8 17 22 23 24 28 43 50 53 55 6...

user output
RIP

Test 10

Group: 2, 3

Verdict:

input
20
9 10 14 17 17 20 21 22 24 25 2...

correct output
1 8 9 13 16 19 30 32 38 40 43 ...

user output
RIP

Test 11

Group: 3

Verdict:

input
100
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

correct output
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

user output
RIP

Test 12

Group: 3

Verdict:

input
100
3 4 5 5 6 6 7 7 7 8 8 8 9 9 9 ...

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
RIP

Test 13

Group: 3

Verdict:

input
100
502824619 505239810 505668108 ...

correct output
1 502824618 505239809 50566810...

user output
RIP

Test 14

Group: 3

Verdict:

input
100
17871832 41618648 51611938 538...

correct output
3939271 13932561 37679377 4989...

user output
RIP

Test 15

Group: 3

Verdict:

input
100
70588435 115481965 116040218 1...

correct output
5902586 64685849 109579379 110...

user output
RIP