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

26997번 - Finding Bovine Roots 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB3312631.579%

문제

The cows are trying to find their roots. They are not so smart as humans when they find square roots, the cows lose the integer portion of their square root calculation. Thus, instead of calculating the square root of 2 to be 1.4142135623730950488016887242096980785696, they deduce that it is 0.4142135623730950488016887242096980785696. The square root of 16 is calculated to be 0 (obviously an error).

The erroneous ciphering does, however, lead to an interesting question. Given a string of digits of length L (1 ≤ L ≤ 9), what is the smallest integer whose bovine square root decimal part begins with those digits?

By way of example, consider the string "123". The square root of 17 is approximately 4.1231056256176605498214098559740770251472 so the bovine square root is: 0.1231056256176605498214098559740770251472 whose decimal part (just after the period) starts with 123. It turns out that 17 is the smallest integer with this property.

입력

  • Line 1: A single integer, L
  • Line 2: L digits (with no spaces)

출력

  • Line 1: A single integer that is the smallest integer whose bovine square root starts with the supplied string

제한

예제 입력 1

3
123

예제 출력 1

17

힌트

출처

Olympiad > USA Computing Olympiad > 2005-2006 Season > USACO December 2005 Contest > Bronze ?번

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

출처

대학교 대회

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

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