-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgen.cpp
More file actions
127 lines (121 loc) · 3.03 KB
/
gen.cpp
File metadata and controls
127 lines (121 loc) · 3.03 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Optimise
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// #define MULTI_TEST
#ifdef LOCAL
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
#define pc(...) PC(#__VA_ARGS__, __VA_ARGS__);
template <typename T, typename U>
ostream &operator<<(ostream &out, const pair<T, U> &p)
{
out << '[' << p.first << ", " << p.second << ']';
return out;
}
template <typename Arg>
void PC(const char *name, Arg &&arg)
{
while (*name == ',' || *name == ' ')
name++;
std::cerr << name << " { ";
for (const auto &v : arg)
cerr << v << ' ';
cerr << " }\n";
}
template <typename Arg1, typename... Args>
void PC(const char *names, Arg1 &&arg1, Args &&... args)
{
while (*names == ',' || *names == ' ')
names++;
const char *comma = strchr(names, ',');
std::cerr.write(names, comma - names) << " { ";
for (const auto &v : arg1)
cerr << v << ' ';
cerr << " }\n";
PC(comma, args...);
}
template <typename Arg1>
void ZZ(const char *name, Arg1 &&arg1)
{
std::cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void ZZ(const char *names, Arg1 &&arg1, Args &&... args)
{
const char *comma = strchr(names + 1, ',');
std::cerr.write(names, comma - names) << " = " << arg1;
ZZ(comma, args...);
}
#else
#define db(...)
#define pc(...)
#endif
using ll = long long;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
auto TimeStart = chrono::steady_clock::now();
auto seed = TimeStart.time_since_epoch().count();
std::mt19937 rng(seed);
template <typename T>
using Random = std::uniform_int_distribution<T>;
const int NAX = 2e5 + 5, MOD = 1000000007;
void getRandStr()
{
int len = Random<int>{1, 20}(rng);
while (len--)
cout << char(Random<int>('a', 'z')(rng));
cout << ' ';
}
void solveCase()
{
int n;
n = Random<int>{1, 20}(rng);
while (n--)
{
int len = Random<int>{1, 20}(rng);
while (len--)
{
switch (Random<int>(0, 2)(rng))
{
case 0:
cout << Random<int>(-100, 100)(rng) << ' ';
break;
case 1:
cout << uniform_real_distribution<double>(-100, 100)(rng) << ' ';
break;
case 2:
getRandStr();
break;
default:
break;
}
}
cout << '\n';
}
}
int32_t main()
{
#ifndef LOCAL
ios_base::sync_with_stdio(0);
cin.tie(0);
#endif
int t = 1;
#ifdef MULTI_TEST
cin >> t;
#endif
for (int i = 1; i <= t; ++i)
{
solveCase();
#ifdef TIME
cerr << "Case #" << i << ": Time " << chrono::duration<double>(chrono::steady_clock::now() - TimeStart).count() << " s.\n";
TimeStart = chrono::steady_clock::now();
#endif
}
return 0;
}