There are K hours left before Agent Mahone leaves Amman! Hammouri doesn't like how things are going in the mission and he doesn't want to fail again. Some places have too many students covering them, while other places have only few students. Wheneve…
题目链接:http://codeforces.com/gym/100283/problem/F F. Bakkar In The Army time limit per test 2 seconds memory limit per test 256 megabytes input army.in output standard output Bakkar is now a senior college student studying computer science. And as many…
Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Practice Description standard input/output Andréh and his friend Andréas are board-game aficionados. They know many of their friend…
Gym 101047K Training with Phuket's larvae Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Practice Description standard input/output Thai cuisine is known for combining seasonings so that every dish has flavors that are…
Gym 101047E Escape from Ayutthaya Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Practice Description standard input/output Ayutthaya was one of the first kingdoms in Thailand, spanning since its foundation in 1350 to…
Gym 101047B Renzo and the palindromic decoration Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Practice Description standard input/output At the ruins of Wat Phra Si Sanphet (วดพระศรสรรเพชญ), one can find famous inscr…
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; namespace ConsoleTest { class Program { static void Main(string[] args) { List<string> listTest = new List<string>(); ; i &l…
二分法: 平均时间复杂度:O(log2n) int halfFuntion(int a[], int length, int number) { int start = 0; int end = length - 1; int index = 0; while(start < end) { index = start + (end - start)/2 if(a[index] == number){ return index; } else if(a[index] < number){…
题目链接 http://codeforces.com/gym/101102/problem/J Description standard input/output You are given an array A of integers of size N, and Q queries. For each query, you will be given a set of distinct integers S and two integers L and R that represent a…
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury of Berland regional olympiad in informatics does not trust to contest management systems, so the Berland regional programming contest is judged by th…
题目链接 http://codeforces.com/gym/100917/problem/D problem description Famous Berland coder and IT manager Linus Gates announced his next proprietary open-source system "Winux 10.04 LTS" In this system command "dir -C" prints list of all…
题目链接 http://codeforces.com/gym/101102/problem/D problem description Given an R×C grid with each cell containing an integer, find the number of subrectangles in this grid that contain only one distinct integer; this means every cell in a subrectangle…
题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM AmrahCPC 2016 as the winner of the contest had the first rank from the second hour until the end of the contest. Bahosain is studying the results of t…
题目地址 分析:如果用二分法,关键是score和aid分开排序,score排序是为了充分利用中位数的性质,这样就可以确定m左右必须各选N/2个,到这之后有人是用dp求最优解,可以再次按照aid排序一次,可以直接确定最优解(肯定是从最小的开始选择!): #include <cstdio> #include <algorithm> #include <cstring> using namespace std; int N, C, F; ; struct Cow{ int i…
Gym Class Accepts: 849 Submissions: 4247 Time Limit: 6000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description 众所周知,度度熊喜欢各类体育活动. 今天,它终于当上了梦寐以求的体育课老师.第一次课上,它发现一个有趣的事情.在上课之前,所有同学要排成一列, 假设最开始每个人有一个唯一的ID,从1到NN,在排好队之后,每个…
Weird Cryptography Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Gym 100935B Description standard input/output Khaled was sitting in the garden under an apple tree, suddenly! , well... you should guess what happened, a…
Board Game Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Gym 100935G Description standard input/outputStatements Feras bought to his nephew Saleem a new game to help him learning calculating. The game consists of a boa…