CF995E Number Clicker 题目描述 Allen is playing Number Clicker on his phone. He starts with an integer u u on the screen. Every second, he can press one of 3 buttons. Turn \(u \to u+1 \pmod{p}\). Turn \(u \to u+p-1 \pmod{p}\). Turn \(u \to u^{p-2} \pmod{…
Nightmare Ⅱ Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 886 Accepted Submission(s): 185 Problem Description Last night, little erriyue had a horrible nightmare. He dreamed that he and hi…
Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from left to right respectively.There are four identical pieces on the board. In one move it is allowed to…
Problem UVA1601-The Morning after Halloween Accept: 289 Submit: 3136 Time Limit: 12000 mSec Problem Description Input Output For each dataset in the input, one line containing the smallest number of steps to restore ghosts into the positions where…
The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by 4 frame with one tile missing. Let's…
Nightmare Ⅱ Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3012 Accepted Submission(s): 856 Problem Description Last night, little erriyue had a horrible nightmare. He dreamed that he and h…