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

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

Gyrating Glyphs

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

요약
10^9+7로 나눈 왼쪽부터 계산하는 식에서 숨겨진 + 또는 * 연산자를 입력을 골라 함수를 호출해 알아낸다.
난이도

보통10점 중 6점

유형
수학, 완전 탐색, 구현
정답자
아직 제출이 없습니다

문제

You are rocking the latest breakthrough in Computer Science: animated fonts. Suddenly, all of your colleagues' code looks amazing, and you are finally motivated to review it. Unfortunately, due to the constant rotations, it is hard to distinguish between the ++ (plus) and the ×\times (multiply) operators (all the other characters are still readable). The function you are reviewing takes as input n+1n+1 integers a_0,a_1,…,a_na\_0, a\_1, \ldots, a\_n and returns the value (…(((a_0,op⁡_1,a_1),op⁡_2,a_2),op⁡_3,a_3)…,op⁡_n,a_n) mod 109+7,\bigg(\ldots\Big(\big((a\_0 \\,\operatorname{op}\_1\\, a\_1) \\,\operatorname{op}\_2\\, a\_2\big) \\,\operatorname{op}\_3\\, a\_3\Big) \ldots \\,\operatorname{op}\_n\\, a\_n\bigg)\quad \bmod 10^9+7, where the nn operators op⁡_1,,op⁡_2,,…,,op⁡_n\operatorname{op}\_1,\\, \operatorname{op}\_2,\\, \ldots,\\, \operatorname{op}\_n are either ++ or ×\times. For example when given input (a_0,a_1,a_2)=(1,1,2)(a\_0,a\_1,a\_2) = (1,1,2) with hidden operators (op⁡_1,op⁡_2)=(+,×)(\operatorname{op}\_1,\operatorname{op}\_2)=(+,\times), then the function returns ((1+1)×2)=4 mod 109+7((1+1)\times2)=4 \bmod 10^9+7.

You can still execute the function a few times on some input and read the returned value. Use this to recover the operators.

예제2

  1. 예제 1

    입력
    2
    
    4
    
    6
    
    
    예상 출력
    
    ? 1 1 2
    
    ? 1 1 3
    
    ! +x
    
  2. 예제 2

    입력
    10
    
    5
    
    6224
    
    640750
    
    
    예상 출력
    
    ? 1 1 1 1 1 1 1 1 1 1 1
    
    ? 0 4 2 4 2 4 2 4 2 4 2
    
    ? 1 2 3 4 5 6 7 8 9 10 11
    
    ! ++xxx+x+xx