File size: 721 Bytes
1fd0050
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <bits/stdc++.h>
using namespace std;

int main(int argc, char* argv[]) {
    int n = 100000;
    int subtask = 3;
    if (argc > 1) n = atoi(argv[1]);
    if (argc > 2) subtask = atoi(argv[2]);

    // Generate a random permutation (ring order)
    vector<int> perm(n);
    iota(perm.begin(), perm.end(), 0);
    mt19937 rng(42);
    shuffle(perm.begin(), perm.end(), rng);

    // Input file format: subtask n
    // Answer file format: permutation
    // Write input file
    cout << subtask << " " << n << endl;

    // Write answer file to stderr
    for (int i = 0; i < n; i++) {
        if (i) fprintf(stderr, " ");
        fprintf(stderr, "%d", perm[i]);
    }
    fprintf(stderr, "\n");

    return 0;
}