Logo
(追記) (追記ここまで)

18141번 - Are They All Integers? 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB92254551759.907%

문제

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 brand new computational model that solves integer problems efficiently. As a software engineer in this Integer Computing Processors Company (ICPC), you are going to write a validator that checks the following:

Given a list of positive integers A[0], . . . , A[n − 1]. Suppose you pick three different elements arbitrarily of this list, A[i], A[j], A[k] with i, j, k being mutually different. Is it true that (A[i]−A[j])/A[k] is always an integer?

입력

The first line of the input contains one integer n indicating the number of positive integers in the list. The second line of the input contains n positive integers A[0], . . . , A[n − 1] separated by blanks.

출력

If (A[i]−A[j])/A[k] is always an integer, then output yes. Otherwise output no.

제한

  • 3 ≤ n ≤ 50
  • 1 ≤ A[0] ≤ A[1] ≤ · · · ≤ A[n − 1] ≤ 100

예제 입력 1

5
1 1 1 1 4

예제 출력 1

yes

예제 입력 2

5
1 2 4 8 16

예제 출력 2

no

힌트

출처

ICPC > Regionals > Asia Pacific > Taiwan > 2019 ICPC Asia Taipei-Hsinchu Regional C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /