日场比赛
WA你离我远点
加油加油!!!up up up!!!
展开
-
Product of Digits URAL - 1014
AC代码(大坑:1*0 = 0)#include <iostream>#include <bits/stdc++.h>using namespace std;int main(){ long long int q; int i, a[120], h; while(cin>>q) { if(q==1) c...转载 2018-06-23 12:23:34 · 450 阅读 · 0 评论 -
String Tale URAL - 1423
BackgroundI want to tell you a story. Not entirely, but only the very beginning, because the ending of this story became a legend of programming—as well as its heroes.When computers were large, when t...转载 2018-06-23 12:53:03 · 115 阅读 · 0 评论 -
Java Beans ZOJ - 3714
There are N little kids sitting in a circle, each of them are carrying some java beans in their hand. Their teacher want to select M kids who seated in M consecutive seats and collect java beans from...原创 2018-06-23 21:12:03 · 133 阅读 · 0 评论 -
Dishonest Sellers CodeForces - 779C
Igor found out discounts in a shop and decided to buy n items. Discounts at the store will last for a week and Igor knows about each item that its price now is ai, and after a week of discounts its pr...原创 2018-06-23 21:14:04 · 178 阅读 · 0 评论 -
A - Diverse Team
There are n students in a school class, the rating of the i-th student on Codehorses is ai. You have to form a team consisting of k students (1≤k≤n) such that the ratings of all team members are disti...原创 2018-06-30 20:51:10 · 285 阅读 · 0 评论 -
B - Substrings Sort
You are given n strings. Each string consists of lowercase English letters. Rearrange (reorder) the given strings in such a way that for every string, all strings that are placed before it are its sub...原创 2018-06-30 20:54:10 · 176 阅读 · 0 评论 -
Topological Sorting
Michael wants to win the world championship in programming and decided to study N subjects (for convenience we will number these subjects from 1 to N). Michael has worked ou...原创 2018-06-19 21:05:08 · 104 阅读 · 0 评论 -
A - Mishka and Contest
Mishka started participating in a programming contest. There are n problems in the contest. Mishka's problem-solving skill is equal to k.Mishka arranges all problems from the contest into a list. Beca...原创 2018-07-03 20:49:18 · 167 阅读 · 0 评论 -
B - Reversing Encryption
A string s of length n can be encrypted by the following algorithm: iterate over all divisors of n in decreasing order (i.e. from n to 1), for each divisor d, reverse the substring s[1…d] (i.e. the ...原创 2018-07-03 20:52:12 · 200 阅读 · 0 评论 -
C - Alphabetic Removals
You are given a string s consisting of n lowercase Latin letters. Polycarp wants to remove exactly k characters (k≤n) from the string s. Polycarp uses the following algorithm k times: if there is at l...原创 2018-07-03 20:56:17 · 148 阅读 · 0 评论 -
Cut the sticks
AC代码:(一个数组存数字种类另一个存这个种类的数字的个数)#include <iostream>#include <bits/stdc++.h>using namespace std;int main(){ int i, n, a[1000+10], b[1000+10], x, h; while(scanf("%d",&n)!=EOF) { ...原创 2018-06-28 22:50:53 · 249 阅读 · 0 评论 -
Identify Smith Numbers
AC代码: (质因数分解) #include <iostream>#include <bits/stdc++.h>using namespace std;long long solve(long long n){ long long sum = 0; while(n) { sum = sum + (n%10); n = ...转载 2018-06-29 00:14:24 · 121 阅读 · 0 评论 -
Maximum Multiple
Problem DescriptionGiven an integer n, Chiaki would like to find three positive integers x, y and z such that: n=x+y+z, x∣n, y∣n, z∣n and xyz is maximum. InputThere are multiple test cases....原创 2018-07-23 17:04:14 · 795 阅读 · 4 评论 -
A - Remove Duplicates
Petya has an array a consisting of n integers. He wants to remove duplicate (equal) elements.Petya wants to leave only the rightmost entry (occurrence) for each element of the array. The relative orde...原创 2018-07-05 21:10:55 · 214 阅读 · 0 评论 -
B - File Name
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more...原创 2018-07-05 21:12:28 · 191 阅读 · 0 评论 -
C - Letters
There are n dormitories in Berland State University, they are numbered with integers from 1 to n. Each dormitory consists of rooms, there are ai rooms in i-th dormitory. The rooms in i-th dormitory ar...原创 2018-07-05 21:14:09 · 730 阅读 · 0 评论 -
Triangle Partition
Chiaki has 3n points p1,p2,…,p3n. It is guaranteed that no three points are collinear.Chiaki would like to construct n disjoint triangles where each vertex comes from the 3n points. InputThe...转载 2018-07-24 08:45:48 · 167 阅读 · 0 评论 -
GukiZ and Contest
Professor GukiZ likes programming contests. He especially likes to rate his students on the contests he prepares. Now, he has decided to prepare a new contest.In total, n students will attend, and b...原创 2018-07-25 09:43:47 · 156 阅读 · 0 评论 -
A - Polycarp's Pockets
Polycarp has n coins, the value of the i-th coin is ai. Polycarp wants to distribute all the coins between his pockets, but he cannot put two coins with the same value into the same pocket.For example...原创 2018-07-07 21:04:30 · 171 阅读 · 0 评论 -
B - Binary String Constructing
You are given three integers a, b and x. Your task is to construct a binary string s of length n=a+b such that there are exactly a zeroes, exactly b ones and exactly x indices i (where 1≤i<n) such ...原创 2018-07-07 21:05:43 · 355 阅读 · 0 评论 -
C - Intense Heat
The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. But an...转载 2018-07-07 21:44:40 · 249 阅读 · 0 评论 -
H - A-B Game
Fat brother and Maze are playing a kind of special (hentai) game by two integers A and B. First Fat brother write an integer A on a white paper and then Maze start to change this integer. Every time M...转载 2018-07-25 15:39:01 · 1918 阅读 · 0 评论 -
L - OOXX Game
Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, there are N*M coins in this board with two symbol “O” or “X”. Then they take tur...原创 2018-07-25 15:41:29 · 5752 阅读 · 0 评论 -
Pokemon Master
Calem and Serena are pokemon masters. One day they decided to have a pokemon battle practice before Pokemon World Championships. Each of them has some pokemons in each's team. To make the battle more ...原创 2018-07-28 19:09:38 · 630 阅读 · 0 评论 -
Ternary Calculation
Complete the ternary calculation.InputThere are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:There is a string in th...原创 2018-07-28 19:11:44 · 313 阅读 · 0 评论 -
Access System
For security issues, Marjar University has an access control system for each dormitory building.The system requires the students to use their personal identification cards to open the gate if they wan...原创 2018-07-28 19:16:02 · 549 阅读 · 0 评论 -
Talented Chef
As we all know, Coach Gao is a talented chef, because he is able to cook M dishes in the same time. Tonight he is going to have a hearty dinner with his girlfriend at his home. Of course, Coach Gao is...转载 2018-07-28 20:01:04 · 180 阅读 · 0 评论 -
A - Vanya and Table
Vanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom to top, the columns are numbered from 1 to 100 from left to right.I...原创 2018-07-26 10:44:13 · 155 阅读 · 0 评论 -
B - Vanya and Books
Vanya got an important task — he should enumerate books in the library and label each book with its number. Each of the n books should be assigned with a number from 1 to n. Naturally, distinct books ...原创 2018-07-26 10:47:46 · 143 阅读 · 0 评论 -
D - Vanya and Triangles
Vanya got bored and he painted n distinct points on the plane. After that he connected all the points pairwise and saw that as a result many triangles were formed with vertices in the painted points. ...原创 2018-07-26 10:49:04 · 189 阅读 · 0 评论 -
What day is that day?
It's Saturday today, what day is it after 11 + 22+ 33 + ... + NN days?InputThere are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For eac...转载 2018-07-29 20:13:48 · 499 阅读 · 0 评论 -
亲和数
古希腊数学家毕达哥拉斯在自然数研究中发现,220的所有真约数(即不是自身的约数)之和为: 1+2+4+5+10+11+20+22+44+55+110=284。 而284的所有真约数为1、2、4、71、 142,加起来恰好为220。人们对这样的数感到很惊奇,并称之为亲和数。一般地讲,如果两个数中任何一个数都是另一个数的真约数之和,则这两个数就是亲和数。 你的任务就编写一个程序,判断给定的两个数...原创 2018-08-03 19:01:53 · 1854 阅读 · 0 评论 -
18岁生日
Gardon的18岁生日就要到了,他当然很开心,可是他突然想到一个问题,是不是每个人从出生开始,到达18岁生日时所经过的天数都是一样的呢?似乎并不全都是这样,所以他想请你帮忙计算一下他和他的几个朋友从出生到达18岁生日所经过的总天数,让他好来比较一下。 Input一个数T,后面T行每行有一个日期,格式是YYYY-MM-DD。如我的生日是1988-03-07。 OutputT行,每行...原创 2018-08-03 19:05:09 · 155 阅读 · 0 评论 -
AC Me
Ignatius is doing his homework now. The teacher gives him some articles and asks him to tell how many times each letter appears. It's really easy, isn't it? So come on and AC ME. InputEach articl...原创 2018-08-03 19:07:07 · 612 阅读 · 0 评论 -
小明A+B
小明今年3岁了, 现在他已经能够认识100以内的非负整数, 并且能够进行100以内的非负整数的加法计算. 对于大于等于100的整数, 小明仅保留该数的最后两位进行计算, 如果计算结果大于等于100, 那么小明也仅保留计算结果的最后两位. 例如, 对于小明来说: 1) 1234和34是相等的 2) 35+80=15 给定非负整数A和B, 你的任务是代表小明计算出A+B的值. Input...原创 2018-08-03 19:09:06 · 114 阅读 · 0 评论 -
The 3n + 1 problem
Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose ...原创 2018-08-03 19:12:57 · 99 阅读 · 0 评论 -
盐水的故事
挂盐水的时候,如果滴起来有规律,先是滴一滴,停一下;然后滴二滴,停一下;再滴三滴,停一下...,现在有一个问题:这瓶盐水一共有VUL毫升,每一滴是D毫升,每一滴的速度是一秒(假设最后一滴不到D毫升,则花费的时间也算一秒),停一下的时间也是一秒这瓶水什么时候能挂完呢? Input输入数据包含多个测试实例,每个实例占一行,由VUL和D组成,其中 0<D<VUL<5000。 ...原创 2018-08-03 19:24:16 · 140 阅读 · 0 评论 -
Eddy's 洗牌问题
Problem DescriptionEddy是个ACMer,他不仅喜欢做ACM题,而且对于纸牌也有一定的研究,他在无聊时研究发现,如果他有2N张牌,编号为1,2,3..n,n+1,..2n。这也是最初的牌的顺序。通过一次洗牌可以把牌的序列变为n+1,1,n+2,2,n+3,3,n+4,4..2n,n。那么可以证明,对于任意自然数N,都可以在经过M次洗牌后第一次重新得到初始的顺序。编程对于小于...原创 2018-07-30 17:15:06 · 738 阅读 · 0 评论 -
七夕节
七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" 人们纷纷来到告示前,都想知道谁才是自己的另一半.告示如下: 数字N的因子就是所有比N小又能被N整除的所有正整数,如12的因子有1,2,3,4,6. 你想知道你的另一半吗? Input输入数据的第一行是一个数字T(1<=T<=...原创 2018-07-30 17:17:28 · 237 阅读 · 0 评论 -
How Many Tables
Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a...转载 2018-07-30 19:34:32 · 112 阅读 · 0 评论