d06 part one
This commit is contained in:
		
							
								
								
									
										13
									
								
								d06/run1.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								d06/run1.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| def main(races, S=1): | ||||
|     for t, d in races: | ||||
|         result = [] | ||||
|         for h in range(0, t+1): | ||||
|             if (h * (t-h)) > d: result.append(h) | ||||
|         S *= len(result) | ||||
|     return S | ||||
|  | ||||
|  | ||||
| if __name__ == '__main__': | ||||
|     races=[(7,9), (15,40), (30,200)] | ||||
|     racesI=[(42,284), (68,1005), (69,1122), (85,1341)] | ||||
|     print(main(racesI)) | ||||
		Reference in New Issue
	
	Block a user
	 Arthur
					Arthur