摘要: Description Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edwar 阅读全文
posted @ 2018-03-18 20:21 GHzz 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Description For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his univers 阅读全文
posted @ 2018-03-18 20:06 GHzz 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-03-17 17:08 GHzz 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 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 its 阅读全文
posted @ 2018-03-17 15:14 GHzz 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> #include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> #include <vector> #include <ma 阅读全文
posted @ 2018-03-16 21:48 GHzz 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1、什么是逆元 当求解公式:(a/b)%m 时,因b可能会过大,会出现爆精度的情况,所以需变除法为乘法: 设c是b的逆元,则有b*c≡1(mod m); 则(a/b)%m = (a/b)*1%m = (a/b)*b*c%m = a*c(mod m); 即a/b的模等于a*b的逆元的模; 2、求逆元的 阅读全文
posted @ 2018-03-15 22:16 GHzz 阅读(338) 评论(0) 推荐(0) 编辑
摘要: Problem Description Sherlock and Watson are playing the following modified version of Nim game: There are n piles of stones denoted as ,,...,, and n i 阅读全文
posted @ 2018-03-14 16:39 GHzz 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 一. 巴什博奕(Bash Game): A和B一块报数,每人每次报最少1个,最多报4个,看谁先报到30。这应该是最古老的关于巴什博奕的游戏了吧。 其实如果知道原理,这游戏一点运气成分都没有,只和先手后手有关,比如第一次报数,A报k个数,那么B报5-k个数,那么B报数之后问题就变为,A和B一块报数,看 阅读全文
posted @ 2018-03-14 16:34 GHzz 阅读(409) 评论(0) 推荐(0) 编辑
摘要: Description Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to m 阅读全文
posted @ 2018-03-10 16:02 GHzz 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 1、隐藏 当同时编译多个文件时,所有未加static关键字的全局变量和函数都具有全局可见性。 例如:同时编译两个源文件 输出: 如果加了static,ghz.c文件就会对其它源文件隐藏。例如在a和GHz的定义前加上static,main.c就看不到它们了。利用这一特性可以在不同的文件中定义同名函数和 阅读全文
posted @ 2018-03-10 15:37 GHzz 阅读(415) 评论(1) 推荐(1) 编辑