D - Ithea Plays With Chtholly 思路:考虑每个位置最多被替换c/2次 那么折半考虑,如果小于c/2,从左往右替换,大于c/2总右往左替换,只有小于这个数(从左往右)或者大于这个数(从右往左)才会被替换,所以每个位置最多被替换c/2次. 代码: #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #defi…
[题目]B. Ithea Plays With Chtholly [题意]交互题,有n格,每次给一个[1,c]的数字,回答填入的位置后再次给数字,要求在m轮内使n格填满且数列不递减.n,m>=2,1<=c<=1000,1<=n*[c/2]<=m<=1000. [算法]贪心 [题解]对于每次的数字x,找到第一个严格大于的位置替换之(或占一个新的空位置). 这样替换的好处是,不改变当前数列已经满足不递减这一事实的前提下,使数列更优. 那么,每个格子最多被替换c次,总轮数为(…
又掉分了0 0. A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He on…
B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output — Thanks a lot for today. — I experienced so many great things. — You gave me memories like dreams... But I have t…
B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output — Thanks a lot for today. — I experienced so many great things. — You gave me memories like dreams... But I have to le…
C. MaratonIME plays Nim time limit per test : 2.0 smemory limit per test : 64 MBinputstandard inputoutputstandard outputAi Fox!UNIONFIND, GERMANOYou open your eyes, but everything remains dark. The world is dark, and everything shakes. You realize yo…
A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He once was th…
Discription Bash got tired on his journey to become the greatest Pokemon master. So he decides to take a break and play with functions. Bash defines a function f0(n), which denotes the number of ways of factoring n into two factors p and q such that …
A. Bear and Five Cards 题目链接:http://codeforces.com/contest/680/problem/A A little bear Limak plays a game. He has five cards. There is one number written on each card. Each number is a positive integer. Limak can discard (throw out) some cards. His go…
E. Memory and Casinos 题目连接: http://codeforces.com/contest/712/problem/E Description There are n casinos lined in a row. If Memory plays at casino i, he has probability pi to win and move to the casino on the right (i + 1) or exit the row (if i = n),…
D. Anton and Chess 题目连接: http://codeforces.com/contest/734/problem/D Description Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the game on 8 to 8 board to…
题目链接: http://codeforces.com/contest/734/problem/D D. Anton and Chess time limit per test4 secondsmemory limit per test256 megabytes 问题描述 Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that pla…
Football Kit Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 432B Description Consider a football tournament where n teams participate. Each team has two football kits: for home games,…
A. Bear and Five Cards time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A little bear Limak plays a game. He has five cards. There is one number written on each card. Each number is a posit…