-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsherlocksquares.py
106 lines (104 loc) · 1.3 KB
/
sherlocksquares.py
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
import math
arr = [[11, 734],
[228, 919],
[71 ,188],
[270, 303],
[312 ,701],
[251 ,325],
[418 ,954],
[407 ,597],
[4 ,4],
[248, 583],
[318, 936],
[176, 769],
[323, 838],
[383, 981],
[152, 560],
[94 ,217],
[232 ,442],
[180 ,447],
[384 ,819],
[175 ,842],
[81 ,451],
[381 ,771],
[260 ,669],
[95 ,558],
[111 ,926],
[212 ,676],
[368 ,424],
[153 ,373],
[127 ,305],
[402 ,737],
[134 ,236],
[130 ,696],
[8 ,963],
[150, 378],
[214, 813],
[242 ,944],
[397 ,743],
[437 ,951],
[295 ,469],
[211 ,865],
[284 ,683],
[125 ,928],
[382 ,484],
[288 ,559],
[273 ,585],
[375 ,376],
[398 ,873],
[362 ,950],
[301 ,539],
[459 ,820],
[243 ,942],
[135 ,432],
[352 ,681],
[261 ,597],
[220 ,440],
[311 ,320],
[274 ,287],
[154 ,806],
[444 ,679],
[360 ,962],
[53 ,571],
[191 ,426],
[269 ,807],
[83 ,141],
[464 ,503],
[61 ,565],
[342 ,857],
[347 ,852],
[497 ,589],
[237 ,803],
[397 ,789],
[356 ,398],
[101 ,822],
[122 ,654],
[294 ,731],
[111 ,236],
[257 ,646],
[438 ,478],
[230 ,457],
[118 ,386],
[485 ,516],
[260 ,435],
[423 ,569],
[144 ,930],
[108 ,989],
[351 ,815],
[493 ,605],
[499 ,720],
[21 ,121],
[30 ,515],
[107 ,997],
[398 ,437],
[105, 997],
[40, 363],
[170 ,807],
[177 ,296],
[49 ,211],
[91, 582],
[44, 940],
[1, 1000]]
for x in arr:
start,end = x[0],x[1]
print (len([x for x in range(math.ceil(math.sqrt(start)),math.floor(math.sqrt(end))+1)]))