You are viewing a single comment's thread. Return to all comments →
Yeah thats not nice... Your approach using lists and all() is much more elegant.
#!/bin/python3 import sys n,m = map(int, input().strip().split(' ')) a = list(map(int, input().split())) b = list(map(int, input().split())) ausgabe = 0 for q in range(max(a), min(b) +1): if all(q % arr == 0 for arr in a) and all(brr % q == 0 for brr in b): ausgabe += 1 print(ausgabe)
Seems like cookies are disabled on this browser, please enable them to open this website
Between Two Sets
You are viewing a single comment's thread. Return to all comments →
Yeah thats not nice... Your approach using lists and all() is much more elegant.