DigMul Series

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Calculate the result of the DigMul series for each input number. All input numbers are separated by newlines.

The DigMul series is defined as follows: All digits from 0-9 are marked as not encountered at the start of the series. For each positive multiple of a number (skipping 0), check each digit. If all digits in that multiple have not been encountered yet, mark each digit in that multiple as encountered. Repeat for each multiple in increasing order to infinity. The result of the series is the set of all digits that were marked as encountered after finishing the series.

The result for each input number is output as the textual representation of each encountered digit in increasing order, followed by a newline.

--david_werecat


note: There is a way to calculate this well within the time and memory constraints.

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

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

Sample output:

123456789
012468
123456789
01234568
015
0123468
0123456789
0124568
123456789
01
123456789
01234689
0123456789
01245678
0135
01234568
0123456789
0123456789
0123456789
02
123456789
012468
0123456789
0124689
0125
0124678
123456789
0124568
0123456789
03

Sample input:_

79
1052
3354
2935
111122222333
1123579
345277
423
1679
2027549984
777
635
102445
96
87
12345
0
1
-1
1
123
456
789
111111110
2344235609
7548842
154425867

Sample output:

0123456789
0123456789
0123456789
01234579
12346789
012345789
01234567
0123456789
0123456789
0123456789
0123456789
0123567
01245
0123456789
0123456789
0123456789

123456789

123456789
123456789
012345689
0123456789
01
0234569
0123456789
0123456789

Sample input:_

2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97
101
103
107
109
113
127
131
137
139
149
151
157
163
167
173
179
181
191
193
197
199
211
223
227
229
233
239
241
251
257
263
269
271
277
281
283
293
307
311
313
317
331
337
347
349
353
359
367
373
379
383
389
397
401
409
419
421
431
433
439
443
449
457
461
463
467
479
487
491
499
503
509
521
523
541
547
557
563
569
571
577
587
593
599
601
607
613
617
619
631
641
643
647
653
659
661
673
677
683
691
701
709
719
727
733
739
743
751
757
761
769
773
787
797
809
811
821
823
827
829
839
853
857
859
863
877
881
883
887
907
911
919
929
937
941
947
953
967
971
977
983
991
997

Sample output:

012468
123456789
015
0123456789
123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
123456789
123456789
123456789
0123456789
0123456789
0123456789
012345678
0123456789
012345678
0123456789
0123456789
0123456789
0123456789
123456789
0123456789
012345789
0123456789
0123456789
012345689
012456789
0123456789
0123456789
0123456789
0123456789
012345678
0123456789
013456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
012346789
123456789
0123456789
012345689
012345689
0123456789
123456789
0123456789
0123456789
0123456789
023456789
0123456789
0123456789
0123456789
0123456789
012345689
012345678
0123456789
0123456789
123456789
0123456789
012346789
012345678
123456789
0123456789
123456789
012345679
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
123456789
0123456789
0123456789
013456789
012345678
0123456789
0123456789
012345678
012345789
0123456789
0123456789
0123456789
012345679
0123456789
123456789
0123456789
012345678
123456789
123456789
0123456789
123456789
0123456789
012345678
0123456789
0123456789
012356789
012345679
012345678
012345689
012345678
013456789
012345678
0123456789
123456789
012456789
0123456789
123456789
0123456789
0123456789
013456789
0123456789
012346789
012345789
012346789
012356789
0123456789
0123456789
012356789
123456789
012345789
023456789
012356789
0123456789
0123456789
012356789
012345789
023456789
0123456789
123456789
0123456789
0123456789
012346789
0123456789
0123456789
123456789
012345689
012345689
123456789
012345678
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
012345789
0123456789
012356789
123456789
012346789
0123456789
012356789
0123456789
123456789

Ranking

PHP _

RankUserSizeTimeDateStatistics
18 should be 0123468, not 012456822940.30632012/08/17 05:40:180B / 2049B / 23B
2no, 0123468 is fine because of 300022940.06132012/08/17 06:10:250B / 2049B / 23B
3no, 0123468 is fine because of 3000 (8,16,24,3000)22940.05822012/08/17 06:12:470B / 2049B / 23B

C# _

RankUserSizeTimeDateStatistics
1david_werecat6150.65002012/08/17 05:26:100B / 384B / 203B
2Actually, 8 should be 012468, so everything's wrong6150.64632012/08/17 05:59:110B / ?B / ?B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs (cheat)4390.11952015/10/05 01:52:00271B / 8B / 158B
2g33k25860.03192013/01/29 15:37:55222B / ?B / ?B

Language Ranking_

RankLangUserSizeScore
1Brainfuckmitchs (cheat)43910000
2C#david_werecat6157138
3PHP8 should be 0123468, not 012456822941913

return top