acm
文章平均质量分 56
xinghaimitu
这个作者很懒,什么都没留下…
展开
-
EXAM 个人赛第八场 Snuke Festival
题目描述 The season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upper, middle and lower. He has原创 2018-08-03 17:29:22 · 182 阅读 · 0 评论 -
洛谷3386 二分图模板(匈牙利算法)
输入输出样例 输入样例#1: 复制 3 1 1 1 2 1 1 1 1 1 输出样例#1: 复制 4 2 1 #include <iostream> #include<bits/stdc++.h> #define ll long long using namespace std; const ll maxn = 1e9+7; const ll maxn1=1...原创 2018-09-15 10:05:16 · 246 阅读 · 0 评论 -
Find Integer
Find Integer Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 0 Accepted Submission(s): 0Special Judge Problem Description people in USS...原创 2018-08-25 19:38:48 · 374 阅读 · 0 评论 -
Dinic 快速网络流算法(模板)
一般的网络流算法,每进行一次增广,都要做 一遍BFS,十分浪费。能否少做几次BFS? 这就是Dinic算法要解决的问题。 Edmonds-Karp的提高余地:需要多次从s到t调 用BFS,可以设法减少调用次数。亦即:使用一种代价较小的高效增广方法。 考虑:在一次增广的过程中,寻找多条增广路 径。然后进行 DFS。 先利用 BFS对残余网络分层,每一个节点的层数就是从源点到它最少要经历的边数。...原创 2018-08-29 19:24:27 · 691 阅读 · 0 评论 -
管家的忠诚(二)
老管家是一个聪明能干的人。他为财主工作了整整10年,财主为了让自已账目更加清楚。要求管家每天记k次账,由于管家聪明能干,因而管家总是让财主十分满意。但是由于一些人的挑拨,财主还是对管家产生了怀疑。于是他决定用一种特别的方法来判断管家的忠诚,他把每次的账目按1,2,3…编号,然后不定时的问管家问题,问题是这样的:在a到b号账中最少的一笔是多少?为了让管家没时间作假他总是一次问多个问题。 ...原创 2018-08-24 10:25:55 · 1692 阅读 · 0 评论 -
计蒜客 管家的忠诚 (线段树模板)
题目描述 老管家是一个聪明能干的人。他为财主工作了整整10年,财主为了让自已账目更加清楚。要求管家每天记k次账,由于管家聪明能干,因而管家总是让财主十分满意。但是由于一些人的挑拨,财主还是对管家产生了怀疑。于是他决定用一种特别的方法来判断管家的忠诚,他把每次的账目按1,2,3…编号,然后不定时的问管家问题,问题是这样的:在a到b号账中最少的一笔是多少?为了让管家没时间作假他总是一次问多个问题。 ...原创 2018-08-24 09:32:04 · 169 阅读 · 0 评论 -
破解D-H协议 (bsgs模板题)
题目描述 假定通讯双方名为Alice和Bob,协议的工作过程描述如下(其中 mod 表示取模运算) : 协议规定一个固定的质数P,以及模P 的一个原根g。P 和g 的数值都是公开的,无需保密。 Alice 生成一个随机数a,并计算 A=g^a\;mod\;PA=gamodP , 将A 通过不安全信道发送给Bob。 Bob 生成一个随机数b,并计算 B=g^b\;mod\...原创 2018-08-21 10:08:26 · 339 阅读 · 0 评论 -
A Partial Order Relation
题目描述 In mathematics, a partial order set formalizes and generalizes the intuitive concept of an ordering, sequencing, or arrangement of elements of a set. It is a binary relation indicating that, for...原创 2018-08-27 21:08:01 · 1415 阅读 · 0 评论 -
Assigning Frequencies
题目描述 Bob wants to assign frequencies to n satellites, numbered from 0 to n − 1. Two distinct satellites are said to be adjacent if, when assigned the same frequency, they interfere with each other. S...原创 2018-08-27 19:49:24 · 306 阅读 · 0 评论 -
Sum of the Line 容斥
题目描述 Consider a triangle of integers, denoted by T. The value at (r, c) is denoted by Tr,c , where 1 ≤ r and 1 ≤ c ≤ r. If the greatest common divisor of r and c is exactly 1, Tr,c = c, or 0 otherwis...原创 2018-08-22 16:50:31 · 140 阅读 · 0 评论 -
果实计数
题目描述 淘淘家有棵奇怪的苹果树,这棵树共有n+1层,标号为0~n。这棵树第0层只有一个节点,为根节点。已知这棵树为b叉树,且保证是一颗满b叉树。如图为一颗满3叉树。 现在,该树第n层的每个节点上都结出了一个苹果,淘淘想知道共结了多少苹果。由于数量可能很大,答案要求输出mod k后的结果。 输入 给出第1层的节点数b和层数n和k. 输出 输出苹果数mod k后的结果。 样例输...原创 2018-08-10 19:33:58 · 263 阅读 · 0 评论 -
序列合并
题目描述 有两个长度都是N的序列A和B,在A和B中各取一个数相加可以得到N^2个和,求这N^2个和中最小的N个。 输入 第一行一个正整数N; 第二行N个整数Ai,满足Ai<=Ai+1且Ai<=10^9; 第三行N个整数Bi, 满足Bi<=Bi+1且Bi<=10^9. 输出 仅一行,包含N个整数,从小到大输出这N个最小的和,相邻数字之间用空格隔开。 样例输入 ...原创 2018-08-10 19:30:42 · 1537 阅读 · 0 评论 -
【分治】循环比赛
题目描述 在修罗王和邪狼亡命天涯的同时,魔法学院一年一度的运动会正开得如火如荼。赛场上,业余评论员墨老师正在给观众作激情解说:“鬣狗群……咬住!咬住!鬣狗头子立功了!不要给斑马任何的机会!伟大的鬣狗!伟大的鬣狗头子!它继承了猛兽光荣的历史和穿透!豹子、老虎、雄狮在这一刻灵魂附体!” 呃,这个,我们不要管那些场上选手的绰号了,现在的问题是有某个项目的n个选手进行循环比赛,其中n=2m,要求每名选手...原创 2018-08-06 10:18:00 · 440 阅读 · 0 评论 -
EXAM 个人赛第八场 Rotation II
题目描述 You are given a grid with 2 rows and 3 columns of squares. The color of the square at the i-th row and j-th column is represented by the character Cij. Write a program that prints YES if this gr...原创 2018-08-03 18:40:23 · 227 阅读 · 0 评论 -
2018 ACM-ICPC Asia Qingdao Regional J BOOKS
Books 传送门:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4067 DreamGrid went to the bookshop yesterday. There are books in the booksh...原创 2018-11-06 20:21:43 · 761 阅读 · 0 评论