D. Game with modulo 题目链接:https://codeforces.com/contest/1104/problem/D 题意: 这题是一个交互题,首先一开始会有一个数a,你最终的目的是要将它猜出来. 每次询问会输出"? x y",然后有: "x" (without quotes), if (x % a)≥(y % a). "y" (without quotes), if (x % a)<(y % a). 最多给你60次…
记录一下第一次写交互题 题目大意:一共有1<<n个人参加一场竞标赛,需要你通过比较两人的胜场来判断谁晋级,最终获得第一名 最多1/3*2^(n+1)次询问,每次询问query(a,b),如果a胜场多返回1,如果b胜场多返回2,相同胜场返回0 找到冠军后输出"! i"(i为冠军的编号) 思路: 每次取四个人一组,因为如果这一组人进行了t轮比赛后,最终有一人胜出,那么他们的胜场将为 [ t , t , t+1 , t+2 ],而且 t 和 t 不能出现在同一组,那么他们的胜场排…
Codeforces Round #297 (Div. 2)A. Vitaliy and Pie Time Limit: 2 Sec Memory Limit: 256 MBSubmit: xxx Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/A Description After a hard day Vitaly got very hungry and he wants to eat his favorite pot…
题目链接:Codeforces Round #298 (Div. 2) A. Exam An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i + 1) always studied side…
D. Game with modulo time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output This is an interactive problem. Vasya and Petya are going to play the following game: Petya has some positive integer num…