CSES - COCI 2006/2007 #4 - Results
Submission details
Task:Zbrka
Sender:untokarila
Submission time:2019-07-26 15:26:26 +0300
Language:C++ (C++11)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.01 sdetails
#20.02 sdetails
#30.02 sdetails
#4--details
#5--details
#6--details
#7--details
#8--details
#9--details
#10--details
#11--details
#12--details

Code

#include <bits/stdc++.h>
#define P 1000000007
#define ll long long

using namespace std;



int main(){
    int q;
    cin >> q;

    for(int n=1; n<=q; n++){
        int d[1010] = {0};

        vector<int> v;
        for(int i=1; i<=n; i++) v.push_back(i);

        while(next_permutation(v.begin(), v.end())){
            int s = 0;
            for(int i=0; i<n; i++){
                for(int j=i+1; j<n; j++){
                    if(v[i]>v[j]) s++;
                }
            }
            d[s]++;
        }
        d[0] = 1;
        for(int i=0; i<n*n/2; i++) cout << d[i] << ' ';
        cout << '\n';
    }

    return 0;
}

Test details

Test 1

Verdict:

input
1 1

correct output
0

user output
(empty)

Test 2

Verdict:

input
9 36

correct output
1

user output

1 1 
1 2 2 1 
1 3 5 6 5 3 1 0 
1 4 9 15 20 22 20 15 9 4 1 0 
...
Truncated

Test 3

Verdict:

input
9 37

correct output
0

user output

1 1 
1 2 2 1 
1 3 5 6 5 3 1 0 
1 4 9 15 20 22 20 15 9 4 1 0 
...
Truncated

Test 4

Verdict:

input
20 191

correct output
0

user output
(empty)

Test 5

Verdict:

input
51 93

correct output
652564375

user output
(empty)

Test 6

Verdict:

input
150 15

correct output
906085333

user output
(empty)

Test 7

Verdict:

input
432 10000

correct output
532401236

user output
(empty)

Test 8

Verdict:

input
987 4

correct output
621481900

user output
(empty)

Test 9

Verdict:

input
999 931

correct output
502211067

user output
(empty)

Test 10

Verdict:

input
999 5000

correct output
722028249

user output
(empty)

Test 11

Verdict:

input
999 8234

correct output
263421764

user output
(empty)

Test 12

Verdict:

input
1000 10000

correct output
463544056

user output
(empty)