아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Interactive Factorial Guessing

면접 대비

시간 제한3.5초메모리 제한1024 MB

요약
정해진 정수 n을 찾기 위해 n!의 원하는 자릿수를 최대 10번 물어볼 수 있으며, 팩토리얼 끝의 0 개수를 이용해 n을 좁힌다.
난이도

보통10점 중 6점

유형
이분 탐색, 수학, 정수론, 구간
정답자
아직 제출이 없습니다

문제

Oh no, this wicked jury hides something from you again, and you need to guess it interactively.

This time, you need to find an integer nn. To do that, you can make at most 10 queries of the form "What is the kk-th decimal digit of the product of all integers from 1 to nn (also known as factorial and denoted as n!n!)?".

예제1

  1. 예제 1

    입력
    2
    
    1
    
    YES
    
    0
    
    2
    
    YES
    
    예상 출력
    
    ? 0
    
    ! 1
    
    ? 0
    
    ? 19997
    
    ! 5982