-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinput_gen.cpp
59 lines (50 loc) · 1.25 KB
/
input_gen.cpp
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
#include <iostream>
#include <fstream>
#include <vector>
#include <random>
#include <ctime>
using namespace std;
int main() {
ofstream ofile;
ofile.open("strong_pattern.txt");
for (int i = 0; i < 1024; i++) {
ofile << "a";
}
ofile.close();
ofile.open("weak_pattern1.txt");
for (int i = 0; i < 26; i++) {
for (int j = 0; j <= i; j++) {
ofile << char('a'+j);
}
}
ofile.close();
ofile.open("weak_pattern2.txt");
for (int i = 0; i < 1024; i++) {
for (char c = 'a'; c <= 'z'; c++) {
ofile << c;
}
}
ofile.close();
mt19937 rand_gen;
rand_gen.seed(time(0));
ofile.open("random_text_4096.txt");
for (int i = 0; i < 4096; i++) {
ofile << char('a' + rand_gen()%26);
}
ofile.close();
ofile.open("random_text_1024.txt");
for (int i = 0; i < 1024; i++) {
ofile << char('a' + rand_gen()%26);
}
ofile.close();
ofile.open("random_text_1M.txt");
for (int i = 0; i < 1024*1024; i++) {
ofile << char('a' + rand_gen()%26);
}
ofile.close();
ofile.open("random_text_10M.txt");
for (int i = 0; i < 1024*1024*10; i++) {
ofile << char('a' + rand_gen()%26);
}
ofile.close();
}