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

33780번 - Cryptography 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB149776352.941%

문제

Dave has just completed the Massive Open Online Course (MOOC) Cryptography on the popular website Coursera.org. Eager to create his own cryptography system -- against the advise of the teacher Dan Boneh to never, ever, ever implement your own crypto-system -- he searches for a SKP (Special Key Prime). A SKP is a prime that is preferably a large number, because the larger the number the more secure it is to use as a key.

Remember that a prime is a number that is only divisible by 1 and itself. For example 2 is a prime because it's only divisible by 1 and 2. 15 however is not a prime since beside 1 and 15, also 3 and 5 happen to divide this number. The number 1 is considered to not be a prime.

Luckily his friend Trudy is quite good at guessing large numbers that could be prime. Your task is given a number by Trudy, to decide whether this is actually a prime or not.

입력

You are given a number 0ドル \leq n \leq 10^{10},ドル the number that Trudy has guessed for Dave to use as a SKP.

출력

You should output "SAFE" (without the quotes) iff the number $n$ is a prime, else your program should output "BROKEN" (again, without the quotes).

제한

예제 입력 1

2

예제 출력 1

SAFE

예제 입력 2

15

예제 출력 2

BROKEN

예제 입력 3

104729

예제 출력 3

SAFE

힌트

출처

University > Delft University of Technology > Sjaars Kampioenschap Programmeren 2014 C번

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

출처

대학교 대회

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

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