08 2019 档案
摘要:比赛链接: "Codeforces Round 572 (Div. 2)" 官方题解: "Editorial of Codeforces Round 572" A. Keanu Reeves 题意 如果一个 01 序列中 0 的数量和 1 的数量不同,就认为这个序列是“好”的。 给定一个
阅读全文
摘要:2015年百度之星程序设计大赛 初赛(1) 1006 比赛链接: "2015年百度之星程序设计大赛 初赛(1)" 题目链接: "HDU 5251" Problem Description 小度熊有一个桌面,小度熊剪了很多矩形放在桌面上,小度熊想知道能把这些矩形包围起来的面积最小的矩形的面积是多少。
阅读全文
摘要:题目链接: "洛谷 P3187 [HNOI2007]最小矩形覆盖" "BZOJ 1185: [HNOI2007]最小矩形覆盖" Description 给定一些点的坐标,要求求能够覆盖所有点的最小面积的矩形, 输出所求矩形的面积和四个顶点坐标 Input 第一行为一个整数n(3 从第2至第n+1行每
阅读全文
摘要:"2019 Multi University Training Contest 10" 补题链接: "2019 Multi University Training Contest 10" 1003 "Valentine's Day" "(HDU 6693)" 题意 有 n 种礼物,第 i 种
阅读全文
摘要:"2019 Multi University Training Contest 9" 补题链接: "2019 Multi University Training Contest 9" 1005 Rikka with Game "(HDU 6684)" 题意 Rikka 和 Yuta 玩游戏。给定一个
阅读全文
摘要:"2019 Multi University Training Contest 8" 补题链接: "2019 Multi University Training Contest 8" 1003 "Acesrc and Good Numbers" "HDU 6659" 题意 定义 f(d, n)
阅读全文
摘要:"2019 Multi University Training Contest 7" 补题链接: "2019 Multi University Training Contest 7" 1001 A + B = C 题意: 给出 a, b, c,求 x, y, z 满足 $a\cdot 10^
阅读全文
摘要:"2019 Multi University Training Contest 6" 补题链接: "2019 Multi University Training Contest 6" 1002 Nonsense Time "(HDU 6635)" 题意 给定包含 n 个不同数字的排列 p。一
阅读全文
摘要:"2019 Multi University Training Contest 5" 补题链接: "2019 Multi University Training Contest 5" 罚时爆炸 自闭场 1004 "equation" "(HDU 6627)" 题意: 给定一个整数 C 和 N
阅读全文
摘要:"2019 Multi University Training Contest 4" 补题链接: "2019 Multi University Training Contest 4" 1001 AND Minimum Spanning Tree "(HDU 6614)" 题意 给定一个有 N 个
阅读全文
摘要:"2019 Multi University Training Contest 3" 补题链接: "2019 Multi University Training Contest 3" 1002 Blow up the city "(HDU 6604)" 题意 给定 n 个点和 m 条边的有向
阅读全文
摘要:"2019 Multi University Training Contest 2" 补题链接: "2019 Multi University Training Contest 2" 1005 Everything Is Generated In Equal Probability "(HDU 65
阅读全文
摘要:"2019 Multi University Training Contest 1" 补题链接: "2019 Multi University Training Contest 1" 1002 Operation "(HDU 6579)" 题意 给定包含 n 个数的序列,m 个询问。询问有两
阅读全文
摘要:题目链接: "HDU 3949" Problem Description XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then
阅读全文
摘要:题目链接: " 113. 最大异或和" 题目描述 这是一道模板题。 给由 n 个数组成的一个可重集 S,每次给定一个数 k,求一个集合 T \subseteq S,使得集合 T 在 S 的所有非空子集的不同的异或和中,其异或和 $T_1\ xor\ T_2\ xor\ ...
阅读全文
摘要:"Codeforces Round 113 (Div. 2)" 题目链接: "Polygons" You've got another geometrical task. You are given two non degenerate polygons A and B as vertex
阅读全文
摘要:题目链接: "公式题 (2)" 比赛链接: "华东交通大学2018年ACM“双基”程序设计竞赛" 题目描述 令f(n)=2 f(n 1)+3 f(n 2)+n,f(1)=1,f(2)=2 令g(n)=g(n 1)+f(n)+n n,g(1)=2 告诉你n,输出g(n)的结果,结果对1e9+7取模 输
阅读全文
摘要:题目链接: "POJ 3070" Problem Description In the Fibonacci integer sequence, F_0 = 0, F_1 = 1, and F_n = F_{n − 1} + F_{n − 2} for n \ge 2. For exa
阅读全文
摘要:题目链接: "HDU 1575" Problem Description A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input 数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(2 对应每组数据,输出Tr(A^k)%9973。 Sam
阅读全文
摘要:题目链接: "POJ 1269" Problem Description We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will int
阅读全文
摘要:题目链接: "POJ 3304" Problem Description Given n segments in the two dimensional space, write a program, which determines if there exists a line such that
阅读全文
摘要:比赛链接: "2019 年百度之星·程序设计大赛 初赛四" 题目链接: "HDU 6719 Strassen" ~~C++ 没写出来~~ 于是直接上 暴力。 好像可以用 。
阅读全文
摘要:题目链接: "POJ 2398" Problem Description Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. Th
阅读全文
摘要:题目链接: "POJ 2318" Problem Description Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem their chi
阅读全文
摘要:2019 杭电多校 10 1007 题目链接: "HDU 6697" 比赛链接: "2019 Multi University Training Contest 10" Problem Description The closest pair of points problem is a well
阅读全文
摘要:2019 杭电多校 10 1005 题目链接: "HDU 6695" 比赛链接: "2019 Multi University Training Contest 10" Problem Description The annual welcome party of the Department of
阅读全文
摘要:2019 杭电多校 10 1003 题目链接: "HDU 6693" 比赛链接: "2019 Multi University Training Contest 10" Problem Description Oipotato loves his girlfriend very much. Sinc
阅读全文
摘要:2019 杭电多校 1 1013 题目链接: "HDU 6590" 比赛链接: "2019 Multi University Training Contest 1" Problem Description After returning with honour from ICPC(Internati
阅读全文
摘要:题目链接: "POJ 3805" Problem Description Numbers of black and white points are placed on a plane. Let’s imagine that a straight line of infinite length is
阅读全文
摘要:题目链接: "UVA 10256" 题意 有n个红点和m个蓝点,问是否存在一条直线能够分开红点和蓝点。 题解 分别求出红点和蓝点的凸包,判断两个凸包是否相交。 凸包不相交的条件: 凸包上的任意点都在另一个凸包的外面 凸包的任意线段都与另一个凸包不相交 代码 cpp include using nam
阅读全文
摘要:题目链接: "POJ 2187" Description Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'.
阅读全文
摘要:2019 杭电多校 9 1006 题目链接: "HDU 6685" 比赛链接: "2019 Multi University Training Contest 9" Problem Description Rikka hates coins, and she used to never carry
阅读全文
摘要:2019 杭电多校 8 1003 题目链接: "HDU 6659" 比赛链接: "2019 Multi University Training Contest 8" Problem Description Acesrc is a famous mathematician at Nanjing Uni
阅读全文
摘要:题目链接: "UVA 811" Description Once upon a time, in a faraway land, there lived a king. This king owned a small collection of rare and valuable trees, wh
阅读全文
摘要:题目链接: "POJ 1113" Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The Ki
阅读全文
摘要:题目链接: "POJ 1113" Description Your friend to the south is interested in building fences and turning plowshares into swords. In order to help with his o
阅读全文
摘要:题目链接: "LightOJ 1203" Problem Description Once there was a lazy monkey in a forest. But he loved banana too much. One day there was a storm in the jung
阅读全文
摘要:题目链接: "HDU 1392" Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he mu
阅读全文
摘要:题目链接: "轰炸区最优选取" 题目描述 现在给出一个正方形地图,其边长为n,地图上有的地方是空的,有的地方会有敌人。 我们现在有一次轰炸敌人的机会,轰炸敌人的区域是一个k k的正方形区域,现在需要你解决的问题就是计算最多轰炸的敌人数量是多少。 输入描述: 本题包含多组数据,每组数据第一行输入两个数
阅读全文
摘要:题目链接: "Rake It In" 比赛链接: "ICPC Asia Nanning 2017" Description The designers have come up with a new simple game called “Rake It In”. Two players, Alic
阅读全文
摘要:题目链接: "Twice Equation" 比赛链接: "ICPC Asia Nanning 2017" Description For given L, find the smallest n no smaller than L for which there exists an p
阅读全文
摘要:题目链接: "The Chosen One" 比赛链接: "ICPC Asia Nanning 2017" 题意 t 组样例,每组给出一个整数 n(2\le n\le 10^{50}),求不大于 n 的最大的 2 的整数次幂。 题解 高精度运算 中的 方法可以直接计算某个大数二进制表
阅读全文
摘要:大数运算之 Java BigInteger 的基本用法 在程序设计竞赛中会遇到高精度运算的问题,C++没有高精度运算,只能手动模拟人工运算,手动实现高精度,而 包中的 提供了高精度的基本运算,因此竞赛中常用 Java 解决高精度运算问题。 ~~当然如果比赛支持 就当我没说。~~ BigInteger
阅读全文
摘要:2019 杭电多校 5 1004 题目链接: "HDU 6627" 比赛链接: "2019 Multi University Training Contest 5" Problem Description You are given two integers N,C and two intege
阅读全文
摘要:2019 杭电多校 8 1009 题目链接: "HDU 6665" 比赛链接: "2019 Multi University Training Contest 8" Problem Description Calabash is the servant of a landlord. The land
阅读全文
摘要:2019 杭电多校 8 1011 题目链接: "HDU 6667" 比赛链接: "2019 Multi University Training Contest 8" Problem Description Roundgod is a famous milk tea lover at Nanjing
阅读全文
摘要:题目链接: "POJ 1753" Problem Description Flip game is played on a rectangular 4x4 field with two sided pieces placed on each of its 16 squares. One side o
阅读全文
摘要:题目链接: "POJ 2251" Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or
阅读全文
摘要:题目链接: "HDU 2553" Problem Description 在 N N 的方格棋盘放置了 N 个皇后,使得它们不相互攻击(即任意 2 个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成 45 角的斜线上。 你的任务是,对于给定的 N,求出有多少种合法的放置方法
阅读全文
摘要:2019 杭电多校 5 1005 题目链接: "HDU 6628" 比赛链接: "2019 Multi University Training Contest 5" Problem Description A sequence of length n is called a permutatio
阅读全文
摘要:2019 杭电多校 7 1011 题目链接: "HDU 6656" 比赛链接: "2019 Multi University Training Contest 7" Problem Description Cuber QQ always envies those Kejin players, who
阅读全文
摘要:比赛链接: "2016 ICPC Mid Central USA Region" 题目链接: "Windy Path" Description Consider following along the path in the figure above, starting from (4,4) an
阅读全文
摘要:Description You have N integers, A_1, A_2, ... , A_N. You need to deal with two kinds of operations. One type of operation is to add some given nu
阅读全文
摘要:2019 杭电多校 7 1006 题目链接: "HDU 6651" 比赛链接: "2019 Multi University Training Contest 7" Problem Description Final Exam is coming! Cuber QQ has now one nigh
阅读全文
摘要:题目链接: "Watch Where You Step" 题意 给定有向图的邻接矩阵,现在需要给该图增加边,使得如果两点可达必直接可达,求需要加边的数量。 题解 首先,如果给定 n 个结点的图中任意两点均可达,那么需要增加的边数为有向完全图的边数 n (n 1) 原来有的边数。 所以先将图
阅读全文
摘要:题目链接: "Coins" Description Alice and Bob are playing a simple game. They line up a row of nn identical coins, all with the heads facing down onto the t
阅读全文
摘要:题目链接: "HDU 1548" Description There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 Here comes the probl
阅读全文
摘要:题目链接: "HDU 2266" Description Now give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’ ’ between
阅读全文
摘要:题目链接: "POJ 3641" Description Fermat's theorem states that for any prime number p and for any integer a 1, ap = a (mod p). That is, if we raise a to th
阅读全文
摘要:题目链接: "POJ 1995" Description People are different. Some secretly read magazines full of interesting girls' pictures, others create an A bomb in their
阅读全文
摘要:问题引入 快速幂用于求解 a ^ n\ mod\ m 的结果。 朴素的做法是直接用循环求解,时间复杂度 O(n)。 可以发现上述代码有重复部分,还可以简化。 进一步优化 相关题目 "POJ 1995"
阅读全文