Task: | Kertoma |
Sender: | Tumppi066 |
Submission time: | 2022-11-02 21:00:02 +0200 |
Language: | Python3 (PyPy3) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.04 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.04 s | 1, 2, 3 | details |
#3 | WRONG ANSWER | 0.06 s | 1, 2, 3 | details |
#4 | WRONG ANSWER | 0.06 s | 1, 2, 3 | details |
#5 | WRONG ANSWER | 0.06 s | 1, 2, 3 | details |
#6 | WRONG ANSWER | 0.05 s | 1, 2, 3 | details |
#7 | WRONG ANSWER | 0.06 s | 2, 3 | details |
#8 | WRONG ANSWER | 0.09 s | 2, 3 | details |
#9 | WRONG ANSWER | 0.06 s | 2, 3 | details |
#10 | WRONG ANSWER | 0.06 s | 2, 3 | details |
#11 | WRONG ANSWER | 0.24 s | 3 | details |
#12 | WRONG ANSWER | 0.33 s | 3 | details |
#13 | TIME LIMIT EXCEEDED | -- | 3 | details |
#14 | TIME LIMIT EXCEEDED | -- | 3 | details |
#15 | TIME LIMIT EXCEEDED | -- | 3 | details |
#16 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
import math import time import random # Testing factorials # [10008, 5780, 5743, 5782, 5807, 5726, 5746, 5729, 5862, 5783] # [9806, 5881, 5721, 5776, 5686, 5837, 5814, 5751, 5940, 5763] # [9924, 5869, 5836, 5710, 5727, 5892, 5676, 5820, 5730, 5795] # [9903, 5888, 5842, 5741, 5769, 5818, 5748, 5739, 5742, 5793] # [9840, 5860, 5701, 5843, 5875, 5761, 5790, 5764, 5737, 5816] # [9867, 5824, 5715, 5766, 5793, 5872, 5801, 5718, 5874, 5761] # [10076, 5806, 5681, 5785, 5767, 5753, 5869, 5765, 5721, 5777] # [9811, 5761, 5734, 5893, 5802, 5891, 5861, 5779, 5654, 5818] # [9956, 5626, 5798, 5762, 5951, 5729, 5854, 5869, 5700, 5763] # [9857, 5765, 5832, 5814, 5595, 5785, 5729, 5912, 5820, 5903] # [9862, 5749, 5828, 5773, 5819, 5859, 5862, 5733, 5800, 5736] # [9841, 5711, 5825, 5798, 5836, 5749, 5896, 5742, 5778, 5849] # [10014, 5845, 5824, 5818, 5730, 5757, 5745, 5825, 5792, 5679] # [9862, 5773, 5845, 5770, 5772, 5844, 5732, 5746, 5851, 5839] # [9801, 5763, 5927, 5751, 5914, 5825, 5822, 5713, 5749, 5777] # [9912, 5912, 5709, 5846, 5889, 5698, 5794, 5709, 5788, 5793] # [9880, 5816, 5862, 5729, 5745, 5838, 5743, 5793, 5801, 5848] # [9969, 5733, 5816, 5728, 5893, 5691, 5741, 5851, 5802, 5839] # [9913, 5806, 5836, 5841, 5874, 5777, 5713, 5767, 5771, 5769] # [9832, 5827, 5799, 5721, 5774, 5956, 5762, 5680, 5862, 5858] # [9894, 5648, 5905, 5615, 5756, 5744, 5850, 5880, 5896, 5888] # [9851, 5932, 5808, 5795, 5804, 5674, 5790, 5723, 5773, 5930] # [9954, 5748, 5810, 5860, 5778, 5730, 5767, 5883, 5731, 5827] # [9882, 5758, 5760, 5803, 5863, 5767, 5781, 5748, 5854, 5877] # [9917, 5890, 5649, 5858, 5843, 5737, 5881, 5794, 5775, 5753] # [9939, 5923, 5729, 5833, 5792, 5688, 5809, 5753, 5724, 5911] # [9965, 5825, 5919, 5792, 5728, 5736, 5806, 5861, 5741, 5736] # [10033, 5766, 5863, 5642, 5735, 5827, 5983, 5682, 5745, 5838] # [9890, 6096, 5724, 5735, 5832, 5752, 5702, 5725, 5829, 5833] # [9837, 5771, 5801, 5836, 5810, 5713, 5686, 5948, 5874, 5846] # [9889, 5724, 5888, 5791, 5822, 5835, 5838, 5744, 5783, 5812] # [9872, 5663, 5876, 5822, 5907, 5759, 5723, 5753, 5808, 5947] # [9940, 5854, 5754, 5887, 5682, 5616, 5843, 5867, 5772, 5920] # [9820, 5894, 5859, 5820, 5894, 5893, 5672, 5726, 5789, 5772] # [10029, 5690, 5852, 5860, 5751, 5831, 5796, 5851, 5780, 5707] # [1308, 658, 687, 684, 694, 636, 695, 685, 672, 693] # [5154, 2884, 2973, 2972, 2901, 2993, 2980, 2941, 2961, 2923]# # [9832, 5827, 5799, 5721, 5774, 5956, 5762, 5680, 5862, 5858] numbers = input("").split(" ") numbers = [int(i) for i in numbers] sum = 0 for i in range(0, len(numbers)): sum += numbers[i] answer = 0 runs = 0 # 1st pass at 1k while len(str(answer)) < sum: answer = math.factorial(runs) runs += 1000 # For some reason it always overshoots by 1k on high values if sum > 20000: runs -= 1000 # 2nd pass at 100 while len(str(answer)) > sum: answer = math.factorial(runs) runs -= 100 if runs < 0: runs = 0 break # 3rd pass at 10 while len(str(answer)) < sum: answer = math.factorial(runs) runs += 10 # Final pass while True: answer = math.factorial(runs) print(runs) if len(str(answer)) == sum: numbersInAnswer = [0,0,0,0,0,0,0,0,0,0] for value in str(answer): numbersInAnswer[int(value)] += 1 if numbersInAnswer == numbers: print(runs) break # Move the delta up and down to find the exact number if len(str(answer)) > sum: runs -= 1 else: runs += 1 # Add randomness to fix getting stuck in "ditches" randNumber = random.randint(-10, 10) while runs + randNumber < 0: randNumber = random.randint(-10, 10) runs += randNumber # Printing the time taken in seconds # print(time.process_time())
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
0 0 1 0 0 0 0 0 0 0 |
correct output |
---|
2 |
user output |
---|
0 7 13 14 14 ... Truncated |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
0 0 0 0 0 0 1 0 0 0 |
correct output |
---|
3 |
user output |
---|
0 11 14 8 2 ... Truncated |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
0 0 1 0 1 0 0 0 0 0 |
correct output |
---|
4 |
user output |
---|
20 13 16 25 16 ... |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
2 0 1 1 0 0 1 0 2 0 |
correct output |
---|
10 |
user output |
---|
20 24 15 24 16 ... Truncated |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
9 3 1 1 2 2 3 1 6 1 |
correct output |
---|
27 |
user output |
---|
40 41 37 35 37 ... Truncated |
Test 6
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 4 3 4 3 2 2 4 3 7 |
correct output |
---|
36 |
user output |
---|
50 42 36 36 |
Test 7
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
71 53 36 30 25 29 42 24 34 29 |
correct output |
---|
199 |
user output |
---|
210 212 216 213 205 ... Truncated |
Test 8
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
71 33 46 38 27 45 36 21 35 35 |
correct output |
---|
205 |
user output |
---|
220 209 203 204 200 ... Truncated |
Test 9
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
93 38 35 26 43 54 38 25 41 34 |
correct output |
---|
222 |
user output |
---|
240 244 250 245 246 ... |
Test 10
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 33 33 45 36 43 38 54 56 36 |
correct output |
---|
242 |
user output |
---|
260 266 256 250 253 ... Truncated |
Test 11
Group: 3
Verdict: WRONG ANSWER
input |
---|
3419 1797 1845 1849 1879 1791 ... |
correct output |
---|
5959 |
user output |
---|
5970 5963 5953 5955 5954 ... |
Test 12
Group: 3
Verdict: WRONG ANSWER
input |
---|
4776 2695 2709 2781 2616 2753 ... |
correct output |
---|
8391 |
user output |
---|
8410 8408 8398 8402 8403 ... |
Test 13
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
20097 12282 12229 12214 12406 ... |
correct output |
---|
32001 |
user output |
---|
(empty) |
Test 14
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
47934 29918 29878 29713 29984 ... |
correct output |
---|
71718 |
user output |
---|
(empty) |
Test 15
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
84691 54156 54277 54533 54296 ... |
correct output |
---|
123123 |
user output |
---|
(empty) |
Test 16
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
99098 63339 63878 64182 63904 ... |
correct output |
---|
142663 |
user output |
---|
(empty) |