-
Notifications
You must be signed in to change notification settings - Fork 0
/
10.cpp
405 lines (397 loc) · 16.6 KB
/
10.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
#include <unistd.h>
#include <iostream>
#include <vector>
using namespace std;
struct star {
int x, y, vx, vy;
star(int X, int Y, int VX, int VY) : x(X), y(Y), vx(VX), vy(VY) {}
};
void draw(const vector<star> &stars) {
cout << "\033[H\033[J";
for (const star &i : stars) {
cout << "\033[35;135H";
if (i.x < 0) {
cout << "\033[" << (-1 * i.x) << "D";
} else {
cout << "\033[" << i.x << "C";
}
if (i.y < 0) {
cout << "\033[" << (-1 * i.y) << "A";
} else {
cout << "\033[" << i.y << "B";
}
cout << "X";
}
cout << "\033[H";
}
int main(int argc, char *argv[]) {
vector<star> stars;
stars.push_back(star(-30509, 41062, 3, -4));
stars.push_back(star(-50990, -20297, 5, 2));
stars.push_back(star(-50968, 51288, 5, -5));
stars.push_back(star(-51003, -40754, 5, 4));
stars.push_back(star(-51011, 10375, 5, -1));
stars.push_back(star(30840, 41058, -3, -4));
stars.push_back(star(-30546, 51284, 3, -5));
stars.push_back(star(-10090, 41065, 1, -4));
stars.push_back(star(-51024, -40755, 5, 4));
stars.push_back(star(30832, -40757, -3, 4));
stars.push_back(star(20597, -20297, -2, 2));
stars.push_back(star(-50964, 51292, 5, -5));
stars.push_back(star(-20303, 20608, 2, -2));
stars.push_back(star(10351, 51292, -1, -5));
stars.push_back(star(30792, 41065, -3, -4));
stars.push_back(star(-51008, 30833, 5, -3));
stars.push_back(star(41023, 51287, -4, -5));
stars.push_back(star(41067, -50987, -4, 5));
stars.push_back(star(-50966, 41060, 5, -4));
stars.push_back(star(30792, -30527, -3, 3));
stars.push_back(star(51246, 10375, -5, -1));
stars.push_back(star(20586, 30831, -2, -3));
stars.push_back(star(-40789, -10071, 4, 1));
stars.push_back(star(51248, 30833, -5, -3));
stars.push_back(star(-10071, -50987, 1, 5));
stars.push_back(star(10378, 30831, -1, -3));
stars.push_back(star(20581, -50978, -2, 5));
stars.push_back(star(-10116, -50984, 1, 5));
stars.push_back(star(-20335, -10073, 2, 1));
stars.push_back(star(-50968, -30529, 5, 3));
stars.push_back(star(51267, -20299, -5, 2));
stars.push_back(star(-51016, -20306, 5, 2));
stars.push_back(star(-10084, 41057, 1, -4));
stars.push_back(star(20589, -30526, -2, 3));
stars.push_back(star(30849, 41065, -3, -4));
stars.push_back(star(10383, 41065, -1, -4));
stars.push_back(star(41059, 51286, -4, -5));
stars.push_back(star(41022, -50987, -4, 5));
stars.push_back(star(20600, 30838, -2, -3));
stars.push_back(star(-20335, -50981, 2, 5));
stars.push_back(star(-20285, 30838, 2, -3));
stars.push_back(star(-10073, 10377, 1, -1));
stars.push_back(star(41069, -50978, -4, 5));
stars.push_back(star(-30567, -50987, 3, 5));
stars.push_back(star(-20291, -30524, 2, 3));
stars.push_back(star(-10076, 51287, 1, -5));
stars.push_back(star(-40788, 51287, 4, -5));
stars.push_back(star(30808, 10378, -3, -1));
stars.push_back(star(-30562, -40759, 3, 4));
stars.push_back(star(-51016, 30833, 5, -3));
stars.push_back(star(20565, -20302, -2, 2));
stars.push_back(star(-51019, 41056, 5, -4));
stars.push_back(star(30802, 10378, -3, -1));
stars.push_back(star(51307, 41059, -5, -4));
stars.push_back(star(51265, -50982, -5, 5));
stars.push_back(star(41080, -50980, -4, 5));
stars.push_back(star(30813, 10378, -3, -1));
stars.push_back(star(30809, -10078, -3, 1));
stars.push_back(star(10346, -20299, -1, 2));
stars.push_back(star(-51016, 10381, 5, -1));
stars.push_back(star(-10081, -20297, 1, 2));
stars.push_back(star(51265, -40755, -5, 4));
stars.push_back(star(51303, 20602, -5, -2));
stars.push_back(star(-50992, -40755, 5, 4));
stars.push_back(star(41059, 51291, -4, -5));
stars.push_back(star(10370, -30529, -1, 3));
stars.push_back(star(-30549, -10071, 3, 1));
stars.push_back(star(-20308, -20297, 2, 2));
stars.push_back(star(10341, 51287, -1, -5));
stars.push_back(star(41079, -40756, -4, 4));
stars.push_back(star(10339, 51292, -1, -5));
stars.push_back(star(-20283, 30829, 2, -3));
stars.push_back(star(41067, -30530, -4, 3));
stars.push_back(star(-10105, -30531, 1, 3));
stars.push_back(star(-40765, -30527, 4, 3));
stars.push_back(star(10356, 51288, -1, -5));
stars.push_back(star(51278, -10073, -5, 1));
stars.push_back(star(-51016, -20298, 5, 2));
stars.push_back(star(-40780, -30528, 4, 3));
stars.push_back(star(-30522, -50980, 3, 5));
stars.push_back(star(-40776, 51289, 4, -5));
stars.push_back(star(20597, -50984, -2, 5));
stars.push_back(star(-10076, -10079, 1, 1));
stars.push_back(star(51294, -50978, -5, 5));
stars.push_back(star(41051, 30836, -4, -3));
stars.push_back(star(41028, -10075, -4, 1));
stars.push_back(star(-50973, 10384, 5, -1));
stars.push_back(star(51246, -20304, -5, 2));
stars.push_back(star(30843, 20611, -3, -2));
stars.push_back(star(-40797, 10378, 4, -1));
stars.push_back(star(51254, 20611, -5, -2));
stars.push_back(star(41052, 51292, -4, -5));
stars.push_back(star(10343, -20297, -1, 2));
stars.push_back(star(-30570, 20609, 3, -2));
stars.push_back(star(-40753, 51284, 4, -5));
stars.push_back(star(20581, 41061, -2, -4));
stars.push_back(star(-30514, -20304, 3, 2));
stars.push_back(star(51246, -30527, -5, 3));
stars.push_back(star(10378, 30836, -1, -3));
stars.push_back(star(51290, 20603, -5, -2));
stars.push_back(star(51247, 51292, -5, -5));
stars.push_back(star(-51008, -20299, 5, 2));
stars.push_back(star(-30553, 30834, 3, -3));
stars.push_back(star(51257, -30526, -5, 3));
stars.push_back(star(41060, 10380, -4, -1));
stars.push_back(star(-30511, 20602, 3, -2));
stars.push_back(star(10367, -50978, -1, 5));
stars.push_back(star(41051, 41056, -4, -4));
stars.push_back(star(-40777, 20603, 4, -2));
stars.push_back(star(30853, 10380, -3, -1));
stars.push_back(star(-10112, 41065, 1, -4));
stars.push_back(star(-40757, 20609, 4, -2));
stars.push_back(star(51303, 20606, -5, -2));
stars.push_back(star(-51022, 41065, 5, -4));
stars.push_back(star(-10106, 10378, 1, -1));
stars.push_back(star(41024, 30829, -4, -3));
stars.push_back(star(-50965, -50987, 5, 5));
stars.push_back(star(51307, -50985, -5, 5));
stars.push_back(star(51270, -30532, -5, 3));
stars.push_back(star(-51014, 30835, 5, -3));
stars.push_back(star(10354, -30526, -1, 3));
stars.push_back(star(-40786, 41058, 4, -4));
stars.push_back(star(-10095, -30524, 1, 3));
stars.push_back(star(-40797, -10072, 4, 1));
stars.push_back(star(20621, 20606, -2, -2));
stars.push_back(star(10346, -10079, -1, 1));
stars.push_back(star(20569, -20297, -2, 2));
stars.push_back(star(51282, 41065, -5, -4));
stars.push_back(star(10398, -40751, -1, 4));
stars.push_back(star(20567, -20306, -2, 2));
stars.push_back(star(-20282, -20305, 2, 2));
stars.push_back(star(-40795, 10379, 4, -1));
stars.push_back(star(51303, 51287, -5, -5));
stars.push_back(star(-10107, 41061, 1, -4));
stars.push_back(star(10338, -20305, -1, 2));
stars.push_back(star(20584, 51283, -2, -5));
stars.push_back(star(-20306, -20297, 2, 2));
stars.push_back(star(41027, 10379, -4, -1));
stars.push_back(star(41040, -30526, -4, 3));
stars.push_back(star(51254, -20301, -5, 2));
stars.push_back(star(30840, -10076, -3, 1));
stars.push_back(star(10370, 10376, -1, -1));
stars.push_back(star(30817, 51292, -3, -5));
stars.push_back(star(-50968, -30527, 5, 3));
stars.push_back(star(30812, -30528, -3, 3));
stars.push_back(star(-30557, 20611, 3, -2));
stars.push_back(star(20575, 41062, -2, -4));
stars.push_back(star(-40763, -10070, 4, 1));
stars.push_back(star(30851, 41060, -3, -4));
stars.push_back(star(30795, -20297, -3, 2));
stars.push_back(star(30848, 20605, -3, -2));
stars.push_back(star(-40757, -10078, 4, 1));
stars.push_back(star(10362, -10070, -1, 1));
stars.push_back(star(-51003, -10074, 5, 1));
stars.push_back(star(20581, -20298, -2, 2));
stars.push_back(star(30792, -50981, -3, 5));
stars.push_back(star(-50991, -30524, 5, 3));
stars.push_back(star(-20319, 41062, 2, -4));
stars.push_back(star(-10072, -50986, 1, 5));
stars.push_back(star(30804, 41057, -3, -4));
stars.push_back(star(-20303, -50984, 2, 5));
stars.push_back(star(41047, 51292, -4, -5));
stars.push_back(star(41038, -20306, -4, 2));
stars.push_back(star(-20284, 41065, 2, -4));
stars.push_back(star(41067, -20298, -4, 2));
stars.push_back(star(-30509, 51290, 3, -5));
stars.push_back(star(-50965, -50983, 5, 5));
stars.push_back(star(20621, 30837, -2, -3));
stars.push_back(star(30796, -10079, -3, 1));
stars.push_back(star(-50999, -40751, 5, 4));
stars.push_back(star(-20339, 10379, 2, -1));
stars.push_back(star(20589, -10077, -2, 1));
stars.push_back(star(-40754, -30526, 4, 3));
stars.push_back(star(41027, -30530, -4, 3));
stars.push_back(star(51278, -50979, -5, 5));
stars.push_back(star(51304, -30533, -5, 3));
stars.push_back(star(-30533, 30838, 3, -3));
stars.push_back(star(10338, 51286, -1, -5));
stars.push_back(star(-40747, 51292, 4, -5));
stars.push_back(star(-10071, -20297, 1, 2));
stars.push_back(star(41061, -50981, -4, 5));
stars.push_back(star(-30511, -50987, 3, 5));
stars.push_back(star(-50964, 10375, 5, -1));
stars.push_back(star(-30546, 41059, 3, -4));
stars.push_back(star(51248, 41065, -5, -4));
stars.push_back(star(20589, -20306, -2, 2));
stars.push_back(star(10338, 30837, -1, -3));
stars.push_back(star(10338, -40753, -1, 4));
stars.push_back(star(-40789, -30531, 4, 3));
stars.push_back(star(-40789, -50984, 4, 5));
stars.push_back(star(51294, -30528, -5, 3));
stars.push_back(star(-20303, 41063, 2, -4));
stars.push_back(star(-10071, 10384, 1, -1));
stars.push_back(star(-30529, 30833, 3, -3));
stars.push_back(star(41075, -20298, -4, 2));
stars.push_back(star(41078, -30529, -4, 3));
stars.push_back(star(51262, 30831, -5, -3));
stars.push_back(star(20613, 20602, -2, -2));
stars.push_back(star(-50968, 41063, 5, -4));
stars.push_back(star(-30512, -40756, 3, 4));
stars.push_back(star(51304, -50987, -5, 5));
stars.push_back(star(30800, -20297, -3, 2));
stars.push_back(star(10370, -20303, -1, 2));
stars.push_back(star(-20282, 30837, 2, -3));
stars.push_back(star(-20335, -50986, 2, 5));
stars.push_back(star(-50964, -30524, 5, 3));
stars.push_back(star(-20319, -40756, 2, 4));
stars.push_back(star(10350, 51291, -1, -5));
stars.push_back(star(-51024, 41064, 5, -4));
stars.push_back(star(-40748, 20611, 4, -2));
stars.push_back(star(-51000, 30837, 5, -3));
stars.push_back(star(-10097, 30834, 1, -3));
stars.push_back(star(20613, -20305, -2, 2));
stars.push_back(star(51258, 41057, -5, -4));
stars.push_back(star(-40757, -50982, 4, 5));
stars.push_back(star(10388, -20297, -1, 2));
stars.push_back(star(-51003, -20297, 5, 2));
stars.push_back(star(-10068, 41062, 1, -4));
stars.push_back(star(10359, -20304, -1, 2));
stars.push_back(star(-10073, 51290, 1, -5));
stars.push_back(star(30840, -20304, -3, 2));
stars.push_back(star(30800, 30834, -3, -3));
stars.push_back(star(10394, 30838, -1, -3));
stars.push_back(star(-40794, -20306, 4, 2));
stars.push_back(star(-51016, -30528, 5, 3));
stars.push_back(star(-10067, 10384, 1, -1));
stars.push_back(star(41067, -10071, -4, 1));
stars.push_back(star(-10076, -50982, 1, 5));
stars.push_back(star(-40741, 10376, 4, -1));
stars.push_back(star(51247, -20302, -5, 2));
stars.push_back(star(-10076, -20305, 1, 2));
stars.push_back(star(-50976, -20302, 5, 2));
stars.push_back(star(41036, 30830, -4, -3));
stars.push_back(star(-50976, -40758, 5, 4));
stars.push_back(star(-10100, -40753, 1, 4));
stars.push_back(star(-30530, 51288, 3, -5));
stars.push_back(star(20613, 51286, -2, -5));
stars.push_back(star(-20311, 10380, 2, -1));
stars.push_back(star(20570, -40760, -2, 4));
stars.push_back(star(41040, -40756, -4, 4));
stars.push_back(star(-30530, 51292, 3, -5));
stars.push_back(star(20613, 10381, -2, -1));
stars.push_back(star(-20287, -10074, 2, 1));
stars.push_back(star(30849, -10079, -3, 1));
stars.push_back(star(41027, 41056, -4, -4));
stars.push_back(star(51287, 51287, -5, -5));
stars.push_back(star(-50971, -30524, 5, 3));
stars.push_back(star(-40776, -50980, 4, 5));
stars.push_back(star(10395, 51283, -1, -5));
stars.push_back(star(10354, -20300, -1, 2));
stars.push_back(star(10378, 20603, -1, -2));
stars.push_back(star(20597, -50985, -2, 5));
stars.push_back(star(-30570, -50987, 3, 5));
stars.push_back(star(20609, 20610, -2, -2));
stars.push_back(star(41062, -50980, -4, 5));
stars.push_back(star(41064, -10079, -4, 1));
stars.push_back(star(30792, -30533, -3, 3));
stars.push_back(star(10362, -30530, -1, 3));
stars.push_back(star(-20282, 10380, 2, -1));
stars.push_back(star(30853, 41057, -3, -4));
stars.push_back(star(41027, -40756, -4, 4));
stars.push_back(star(-20322, 51285, 2, -5));
stars.push_back(star(-30558, -30532, 3, 3));
stars.push_back(star(20623, -20302, -2, 2));
stars.push_back(star(10395, 10379, -1, -1));
stars.push_back(star(51295, 41065, -5, -4));
stars.push_back(star(-10116, 30833, 1, -3));
stars.push_back(star(-40741, 51286, 4, -5));
stars.push_back(star(10362, 10380, -1, -1));
stars.push_back(star(30816, -10071, -3, 1));
stars.push_back(star(30803, 20604, -3, -2));
stars.push_back(star(30834, 20605, -3, -2));
stars.push_back(star(-30534, 41065, 3, -4));
stars.push_back(star(-50984, 20608, 5, -2));
stars.push_back(star(51294, -50981, -5, 5));
stars.push_back(star(10371, -40751, -1, 4));
stars.push_back(star(41059, -50978, -4, 5));
stars.push_back(star(-40797, -10078, 4, 1));
stars.push_back(star(10354, 20605, -1, -2));
stars.push_back(star(-50992, -30525, 5, 3));
stars.push_back(star(-30554, -50983, 3, 5));
stars.push_back(star(30795, -30529, -3, 3));
stars.push_back(star(-10055, -30526, 1, 3));
stars.push_back(star(-50992, -40759, 5, 4));
stars.push_back(star(-20295, -40755, 2, 4));
stars.push_back(star(-20322, -10071, 2, 1));
stars.push_back(star(41060, 51288, -4, -5));
stars.push_back(star(-51011, 30838, 5, -3));
stars.push_back(star(30819, -20297, -3, 2));
stars.push_back(star(10359, 30837, -1, -3));
stars.push_back(star(30801, 10379, -3, -1));
stars.push_back(star(10394, -50982, -1, 5));
stars.push_back(star(-30546, -20303, 3, 2));
stars.push_back(star(-30562, -20304, 3, 2));
stars.push_back(star(-20339, 41056, 2, -4));
stars.push_back(star(-50964, -20302, 5, 2));
stars.push_back(star(10343, 20611, -1, -2));
stars.push_back(star(10370, -20301, -1, 2));
stars.push_back(star(-20343, 20606, 2, -2));
stars.push_back(star(30832, 10383, -3, -1));
stars.push_back(star(20565, 20611, -2, -2));
stars.push_back(star(30797, 30838, -3, -3));
stars.push_back(star(41080, 30831, -4, -3));
stars.push_back(star(20597, -10076, -2, 1));
stars.push_back(star(-50995, 41065, 5, -4));
stars.push_back(star(-40793, -10079, 4, 1));
stars.push_back(star(10378, -30531, -1, 3));
stars.push_back(star(30848, 10375, -3, -1));
stars.push_back(star(-10076, -40758, 1, 4));
stars.push_back(star(-40736, -30530, 4, 3));
stars.push_back(star(-40776, -20301, 4, 2));
stars.push_back(star(-10068, 41056, 1, -4));
stars.push_back(star(-30529, 10379, 3, -1));
stars.push_back(star(-30570, 10377, 3, -1));
stars.push_back(star(-20295, -10075, 2, 1));
stars.push_back(star(51247, -40760, -5, 4));
stars.push_back(star(-40773, -40755, 4, 4));
stars.push_back(star(30809, -50982, -3, 5));
stars.push_back(star(-30551, 51283, 3, -5));
stars.push_back(star(-10116, 10376, 1, -1));
stars.push_back(star(-10115, -40751, 1, 4));
stars.push_back(star(-20311, -20298, 2, 2));
stars.push_back(star(-10098, 10375, 1, -1));
stars.push_back(star(30849, -50978, -3, 5));
//test data.
// stars.push_back(star(9, 1, 0, 2));
// stars.push_back(star(7, 0, -1, 0));
// stars.push_back(star(3, -2, -1, 1));
// stars.push_back(star(6, 10, -2, -1));
// stars.push_back(star(2, -4, 2, 2));
// stars.push_back(star(-6, 10, 2, -2));
// stars.push_back(star(1, 8, 1, -1));
// stars.push_back(star(1, 7, 1, 0));
// stars.push_back(star(-3, 11, 1, -2));
// stars.push_back(star(7, 6, -1, -1));
// stars.push_back(star(-2, 3, 1, 0));
// stars.push_back(star(-4, 3, 2, 0));
// stars.push_back(star(10, -3, -1, 1));
// stars.push_back(star(5, 11, 1, -2));
// stars.push_back(star(4, 7, 0, -1));
// stars.push_back(star(8, -2, 0, 1));
// stars.push_back(star(15, 0, -2, 0));
// stars.push_back(star(1, 6, 1, 0));
// stars.push_back(star(8, 9, 0, -1));
// stars.push_back(star(3, 3, -1, 1));
// stars.push_back(star(0, 5, 0, -1));
// stars.push_back(star(-2, 2, 2, 0));
// stars.push_back(star(5, -2, 1, 2));
// stars.push_back(star(1, 4, 2, 1));
// stars.push_back(star(-2, 7, 2, -2));
// stars.push_back(star(3, 6, -1, -1));
// stars.push_back(star(5, 0, 1, 0));
// stars.push_back(star(-6, 0, 2, 0));
// stars.push_back(star(5, 9, 1, -2));
// stars.push_back(star(14, 7, -2, 0));
// stars.push_back(star(-3, 6, 2, -1));
for (int i = 0; i < 10227; i++) {
for (star &j : stars) {
j.x += j.vx;
j.y += j.vy;
}
cout << i << endl;
draw(stars);
fflush(stdout);
if (i > 10220)
usleep(50000);
}
return 0;
}