#P10364. [PA 2024] Dzielniki

    ID: 14398 远端评测题 15000ms 1024MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2024交互题Special JudgePA(波兰)

[PA 2024] Dzielniki

Background

PA 2024 5B1

Problem Description

This problem is translated from PA 2024 Round 5 Dzielniki.

We have chosen an integer xx from the interval [1,n][1,n]. Your task is to guess this number. You do not have to guess blindly; you can ask questions. In each question, you may choose an integer yy in the interval [0,c][0,c], and we will tell you the number of divisors of x+yx+y.

To make the problem a bit harder, you need to solve tt test cases in a single run. The total number of questions is limited to qq.

Input Format

At the beginning of your program, you should not use #include "dzilib.h" to include the interactive library.

You need to implement the following function to solve this problem.

  • void Solve():The program will call this function only once. In this function, you must implement all the logic for guessing all tt test cases.

You may call the following functions.

  • int GetT():Returns the value of tt.
  • long long GetN():Returns the value of nn.
  • int GetQ():Returns the value of qq.
  • long long GetC():Returns the value of cc.
  • int Ask(long long y):Returns the number of divisors of the sum of the hidden number xx and yy. You must ensure 0yc0\le y\le c.
  • void Answer(long long x):Make an answer. This function has no return value.

If the total number of calls to Ask() exceeds qq, your program will be judged as Wrong Answer. If for any call to Answer(), the number you guessed is different from the correct answer, your program will also be judged as Wrong Answer.

Hint

Constraints

Subtask ID tt nn qq cc
11 5050 10510^5 5000050000 101210^{12}
22 10610^6 50005000
33 1010 10910^9 5000050000
44 101410^{14} 50005000 101710^{17}
55 20002000
66 13001300
77 950950
88 820820
99 750750
1010 720720

Translated by ChatGPT 5