2016 Al-Baath University Training Camp Contest-1 A题:http://codeforces.com/gym/101028/problem/A 题意:比赛初始值是1500,变化了几次,得到的正确结果和bug后的是否相等.(Tourist大佬好 Y(^o^)Y) #include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { in…
1009,直接贪心,只要让后面的尽量小,第一位和第二位尽量大即可. 1011,直接统计奇数的字母的个数,然后用偶数的个数平均分配到它们上面即可.代码如下: #include <stdio.h> #include <algorithm> #include <string.h> using namespace std; int main() { int T; scanf("%d",&T); while(T--) { int n; , even =…
Description ACM-SCPC-2017 is approaching every university is trying to do its best in order to be the Champion, there are n universities, the ith of them has exactly ai contestants. No one knows what is the official number of contestants in each team…
Description Zaid has two words, a of length between 4 and 1000 and b of length 4 exactly. The word a is 'good' if it has a substring which is equal tob. However, a is 'almost good' if by inserting a single letter inside of it, it would become 'good'.…
Description Tourist likes competitive programming and he has his own Codeforces account. He participated in lots of Codeforces Rounds, solved so many problems and became "Legendary Grand Master" (the highest rank on Codeforces). One day, he logg…
题目链接:http://codeforces.com/problemset/gymProblem/101028/I I. March Rain time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output It is raining again! Youssef really forgot that there is a chance of…
Problem F. Grab The Tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 2004 Accepted Submission(s): 911 Problem Description Little Q and Little T are playing a game on a tree. There are …
Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1770 Accepted Submission(s): 1089 Problem Description Alice and Bob are playing a game. The game is played on a set of positive integers…
Maximum Multiple Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3985 Accepted Submission(s): 926 Problem Description Given an integer n, Chiaki would like to find three positive integers x,…
Description X is fighting beasts in the forest, in order to have a better chance to survive he's gonna buy upgrades for his weapon. Weapon upgrade shops are available along the forest, there are n shops, where the ith of them provides an upgrade with…
Description It is raining again! Youssef really forgot that there is a chance of rain in March, so he didn't fix the roof of his house. Youssef's roof is 1-D, and it contains n holes that make the water flow into the house, the position of hole i is…
Description You've possibly heard about 'The Endless River'. However, if not, we are introducing it to you. The Endless River is a river in Cambridge on which David and Roger used to sail. This river has the shape of a circular ring, so if you kept…
Description The forces of evil are about to disappear since our hero is now on top on the tower of evil, and all what is left is the most evil, most dangerous monster! The tower has h floors (numbered from 1 to h, bottom to top), each floor has w roo…
Description X is well known artist, no one knows the secrete behind the beautiful paintings of X except his friend Y, well the reason that Y knows X's secrete is that he is that secret. Y is a programmer and he helps X with drawing paintings using co…
Description Rami went back from school and he had an easy homework about bitwise operations (and,or,..) The homework was like this : You have an equation : " A | B = C " ( this bar '|' means OR ) you are given the value of A and B , you need to…
Description A group of junior programmers are attending an advanced programming camp, where they learn very difficult algorithms and programming techniques! Near the center in which the camp is held, is a professional bakery which makes tasty pastrie…
Solved A HDU 6298 Maximum Multiple Solved B HDU 6299 Balanced Sequence Solved C HDU 6300 Triangle Partition Solved D HDU 6301 Distinct Values E HDU 6302 Maximum Weighted Matching F HDU 6303 Period Sequence Solved G HDU 6304 Chiaki Sequence Revisi…
目录 Cookies Distinct Sub-palindromes Fibonacci Sum Finding a MEX Leading Robots Math is Simple Minimum Index Mow Cookies 先简单二分出最后查的是哪个标号. 然后发现这个可以快速处理出一段区间的答案,分段打表即可. 注意代码长度限制不要爆了我就白打了 10min Code ll n, k, a[N]; ll S[4001] = { ... }; int m; inline ll c…
8/13 2016 Multi-University Training Contest 2官方题解 数学 A Acperience(CYD)题意: 给定一个向量,求他减去一个 α(>=0)乘以一个值为任意+1或-1的B向量后得到向量,求这个向量膜的最小值思路: 展开式子,当时最小,结果为. 代码: #include <bits/stdc++.h> using namespace std; long long w,a,b,c,a2; long long gcd(long long x,l…
6/12 2016 Multi-University Training Contest 4官方题解 KMP+DP A Another Meaning(CYD) 题意: 给一段字符,同时给定你一个单词,这个单词有双重意思,字符串中可能会有很多这种单词,求这句话的意思总数:hehe. 思路: 可以用kmp算法快速求出串中的单词数量,若单词是分开的,每个单词有两种意思,可以直接相乘,若两个及以上单词在原串中是有交集的,那么数量不是直接相乘,发现这片连在一起的单词数量dp[i]=dp[i-1]+dp[j…
Differencia Time Limit: 10000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 601 Accepted Submission(s): 173 Problem Description Professor Zhang has two sequences a1,a2,...,an and b1,b2,...,bn. He wants to…
Rigid Frameworks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 337 Accepted Submission(s): 273 Problem Description Erik Demaine is a Professor in Computer Science at the Massachusetts Insti…