题目描述 We know thatIvan gives Saya three problems to solve (Problem F), and this is the firstproblem. "We need a programmer to help us for some projects. If you show us that youor one of your friends is able to program, you can pass the first hurdle. I…
Description A Swiss-system tournament is a tournament which uses a non-elimination format. The first tournament of this type was a chess tournament in Zurich in 1895, hence the name "Swiss system". The tournament will be held based on following…
Description In mathematics, a square number is an integer that is the square of an integer. In other words, it is the product of some integer with itself. For example, 9 is a square number, since it can be written as 3 * 3. Given an array of distinct…
Binomial Coeffcients TimeLimit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 输入 输出 示例输入 1 1 10 2 954 723 示例输出 /******************* 组合数学 组合数 用 递推  :组合数公式 C[n][m] = C[n-1][m-1] + C[n-1][m] ************************/ Code: #include <iostream> #include…
Crack Mathmen TimeLimit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Since mathmen take security very seriously, theycommunicate in encrypted messages. They cipher their texts in this way: for everycharacther c in the message, they replace c with…
题目描述 We know thatif a phone number A is another phone number B's prefix, B is not able to becalled. For an example, A is 123 while B is 12345, after pressing 123, we callA, and not able to call B. Given N phone numbers, your task is to find whether t…
Greatest Number Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Saya likes math, because she think math can make her cleverer. One day, Kudo invited a very simple game: Given N integers, then the players choose no more than four integers f…
Description BIGZHUGOD and his three friends are playing a game in a triangle ground. The number of BIGZHUGOD is 0, and his three friends are numbered from 1 to 3. Before the game begins, three friends stand on three vertices of triangle in numerical…
Problem Description On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave because it is there. Somewhere deep in the cave, she found a treasure chest with a com…
---恢复内容开始--- Description Given a 3-dimension ellipsoid(椭球面) your task is to find the minimal distance between the original point (0,0,0) and points on the ellipsoid. The distance between two points (x 1,y 1,z 1) and (x 2,y 2,z 2) is defined as    Inp…
Description We know that if a phone number A is another phone number B’s prefix, B is not able to be called. For an example, A is 123 while B is 12345, after pressing 123, we call A, and not able to call B. Given N phone numbers, your task is to find…
Description Both Saya and Kudo like balloons. One day, they heard that in the central park, there will be thousands of people fly balloons to pattern a big image. They were very interested about this event, and also curious about the image. Since the…
Triple Nim Time Limit: 2000MS Memory limit: 65536K 题目描述 Alice and Bob are always playing all kinds of Nim games and Alice always goes first. Here is the rule of Nim game: There are some distinct heaps of stones. On each turn, two players should remov…
Memory Leak Time Limit: 2000MS Memory limit: 131072K 题目描述 Memory Leak is a well-known kind of bug in C/C++. When a string is longer than expected, it will visit the memory of next array which will cause the issue and leak some information. You can se…
Reversed Words Time Limit: 2000MS Memory limit: 131072K 题目描述 Some aliens are learning English. They have a very strange way in writing that they revered every word in the sentence but keep all the words in common order. For example when they want to…
The Binding of Isaac Time Limit: 2000MS Memory limit: 65536K 题目描述 Ok, now I will introduce this game to you... Isaac is trapped in a maze which has many common rooms- Like this-There are 9 common rooms on the map. And there is only one super-secret r…
Fibonacci Time Limit: 2000MS Memory limit: 131072K 题目描述 Fibonacci numbers are well-known as follow: Now given an integer N, please find out whether N can be represented as the sum of several Fibonacci numbers in such a way that the sum does not inclu…
Julyed Time Limit: 2000MS Memory limit: 65536K 题目描述 Julyed is preparing for her CET-6. She has N words to remember, but there is only M days left. If she can't remember all these words, she won't pass CET-6. If she can't pass CET-6, she will be unhap…
记第五届山东省ACM程序设计比赛 5月10日上午9点半左右,我们的队伍从学校出发,一个多小时后到达本次比赛的地点-哈尔滨工业大学. 报道,领材料,吃午饭,在哈工大的校园里逛了逛,去主楼的自习室歇息了一会.然后參加下午两点到四点的热身赛.不得不吐槽一下热身赛的题目,第一个题题目的数据范围写的是十的六次方,我们写出来提交怎么也不正确,后来快结束时看讨论板,管理人员说数据范围是十的九次方,无语了.第二个题目无输入,仅仅输出1到20之间的一个随机整数,题目上也明白说了是拼人品的题目,有的队伍"人品比較好…
HEX SDUT 3896 17年山东省赛D题这个题是从矩形的左下角走到右上角的方案数的变形题,看来我对以前做过的题理解还不是太深,或者是忘了.对于这种题目,直接分析它的性质就完事了.从(1,1)走到(a,b)向左走的步数和向右走的步数是确定的,向下是代表向左向右各走了一步.细节:利用对称性,线性推逆元 对于每一种情况,向左下.向右下.向下的次数都是确定的,然后,对于每一种方向内部顺序不用考虑,然后排列组合就完事了对称性上又出错了,哎,自己也没找个小数据试一下,就...(a,b)和(a,a-b+…
山东省ACM多校联盟省赛个人训练第六场 D Rotating Scoreboard https://vjudge.net/problem/POJ-3335 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 This year, ACM/ICPC World finals will be held in a hall in form of a simple polygon. The coac…
2013年山东省赛F题 Mountain Subsequences先说n^2做法,从第1个,(假设当前是第i个)到第i-1个位置上哪些比第i位的小,那也就意味着a[i]可以接在它后面,f1[i]表示从第一个开始,以a[i]为结尾的不同递增序列的个数,要加上1,算上本身.正反各跑一遍,答案加一下(f1[i]-1)*(f2[i]-1)优化就是,比a[i]小的,只有a[i]-1个 #include<iostream> #include<cstdio> #include<queue&…
怎样遍历一个list 符合下列条件 1. 按照元组的第一个从小到大排序 2. 如果第一个相同 则按照元组第2个从大到小 排序 a = [[2,3],[4,1],(2,8),(2,1),(3,4)] b = sorted(a,key=lambda x: (x[0], -x[1])) print b a = [[2,{'a':8}],[4,{'a':1}],(2,{'a':8}),(2,{'a':1}),(3,{'a':4})] array = [7,8] def fun(x): return (-…
MySQL分组排序(取第一或最后) 方法一:速度非常慢,跑了30分钟 SELECT custid, apply_date, rejectrule FROM ( SELECT *, IF ( , ) AS rank, @pkey := custid FROM ( SELECT custid, createTime, SUBSTR( createTime, , ) AS apply_date, rejectRule, STATUS FROM ( SELECT * FROM credit.`apply…
Fruit Ninja II Time Limit: 5000MS Memory limit: 65536K 题目描述 Have you ever played a popular game named "Fruit Ninja"? Fruit Ninja (known as Fruit Ninja HD on the iPad and Fruit Ninja THD for Nvidia Tegra 2 based Android devices) is a video game d…
The Android University ACM Team Selection Contest Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述  Now it's 20000 A.D., and the androids also participate in the ACM Inter-national Collegiate Programming Contest (ACM/ICPC). In order to sele…
题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous ACMers there. Cainiao attended Asia Regional Contest Fuzhou Site on N…
Hello World! Time Limit: 1000MS Memory limit: 65536K 题目描述 We know that Ivan gives Saya three problems to solve (Problem F), and this is the first problem.“We need a programmer to help us for some projects. If you show us that you or one of your frien…
Time Limit: 5000MS Memory limit: 65536K 题目描述 Haveyou ever played a popular game named "Fruit Ninja"? Fruit Ninja (known as Fruit Ninja HD on the iPad and Fruit Ninja THD for NvidiaTegra 2 based Android devices) is a video game developed by Halfb…
Boring Counting Time Limit: 3000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述     In this problem you are given a number sequence P consisting of N integer and Pi is the ith element in the sequence. Now you task is to answer a list of queries, for each…