본문 바로가기
python-algorithm

백준 18141 Are They All Integers?

by 무적김두칠 2023. 11. 28.

https://www.acmicpc.net/problem/18141

 

18141번: Are They All Integers?

Computing using integers is a dream for every programmer. That is, you do not have to deal with floating point numbers, estimated errors, and etc. We do not even need any floating point units in our computers for divisions! Your company claimed there is a

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
from itertools import permutations
def solution(nums):
    nums = list(permutations(nums,3))
    for num in nums:
        if (num[0- num[1]) / num[2!= (num[0- num[1]) // num[2]:
            return 'no'
    return 'yes'
 
 
if __name__ == '__main__':
    n = int(input())
    nums = list(map(int, input().split()))
    print(solution(nums))
 
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 8892 팰린드롬  (1) 2023.11.29
백준 10448 유레카 이론  (0) 2023.11.28
백준 15122 Forbidden Zero  (0) 2023.11.28
백준 16283 Farm  (2) 2023.11.28
백준 1440 타임머신  (1) 2023.11.28

댓글