从这里开始 题目列表 瞎扯 Problem A Find a Number Problem B Berkomnadzor Problem C Cloud Computing Problem D Garbage Disposal Problem E Getting Deals Done Problem F Debate Problem G Monsters and Potions Problem H BerOS File Suggestion Problem I Privatization of…
第一次打ACM比赛,和yyf两个人一起搞事情 感觉被两个学长队暴打的好惨啊 然后我一直做傻子题,yyf一直在切神仙题 然后放一波题解(部分) A. Find a Number LINK 题目大意 给你d和s,求你一个最小的数满足是d的倍数且数字和是s 思路 从高位到低位考虑广搜,把当前的长度和模d的余数作为状态,然后添加一个数就在对应的位置上加 一个模数只记录长度最小的状态,然后可以反着贪心回去 yyf的神仙code: #include <iostream> #include <cstd…
A. Find a Number 找到一个树,可以被d整除,且数字和为s 记忆化搜索 static class S{ int mod,s; String str; public S(int mod, int s, String str) { this.mod = mod; this.s = s; this.str = str; } } public static void main(String[] args) { IO io = new IO(); int[][]vis=new int[550…
A. Find a Number Solved By 2017212212083 题意:$找一个最小的n使得n % d == 0 并且 n 的每一位数字加起来之和为s$ 思路: 定义一个二元组$<d, s>$ 表示当前状态模d的值,以及每一位加起来的值 跑最短路,从$<0, 0> 跑到 <0, s>$ #include<bits/stdc++.h> using namespace std; ; const int INF = 0x3f3f3f3f; #de…
A Hanoi Tower 递归 题意: 大家都很熟悉汉诺塔的递归程序,现在给你一个组合,询问你这个组合是否会出现在汉诺塔的递归过程中. 题解: 将汉诺塔的递归程序反过来思考,考虑当前最大的那个盘,我们只会将他从from移动到to,他上面的盘都移动到tmp,那么这个最大的盘一定不会在tmp.如果这个盘在from,说明当前正在进行的过程是将他上面的盘从from移动到tmp,如果这个盘在to,那么说明当前正在进行的过程是将他上面的盘从tmp移动到to.递归下去即可. 代码: #include<str…
2015-2016 ACM-ICPC, NEERC, Northern Subregional Contest D Problem D. Distribution in Metagonia Input file: distribution.in Output file: distribution.out Time limit: 2 seconds Memory limit: 256 megabytes There are one hundred noble families in the cou…
Problem G. Garden Gathering Input file: standard input Output file: standard output Time limit: 3 seconds Memory limit: 512 megabytes Many of you may have been to St. Petersburg, but have you visited Peterhof Palace? It is a collection of splendid pa…
Problem D. Delay Time Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 512 megabytes Petr and Egor are measuring the gravitational acceleration g on their physics lessons using a special device. An electromag…
http://acm.hdu.edu.cn/showproblem.php?pid=4710 Balls Rearrangement Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 735 Accepted Submission(s): 305 Problem Description Bob has N balls and A b…
http://acm.hdu.edu.cn/showproblem.php?pid=4708 Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description Alice was felling into a cave. She found a strange door with a number square m…
http://acm.hdu.edu.cn/showproblem.php?pid=4715 Difference Between Primes Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description All you know Goldbach conjecture.That is to say, Every even integer great…
http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 1610 Accepted Submission(s): 630 Problem Description (From wikipedia) For bina…
hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2005 Accepted Submission(s): 563 Problem Description Little Joh…
http://acm.hdu.edu.cn/showproblem.php?pid=4707 Pet Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in th…
http://acm.hdu.edu.cn/showproblem.php?pid=4706 Children's Day Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description Today is Children's Day. Some children ask you to output a big letter 'N'. 'N' is c…
2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest, qualification stage A. Union of Doubly Linked Lists 题目描述:给出很多个双向链表,将它们连成一个双向链表. solution 模拟,尾连头. 时间复杂度:\(O(n)\) B. Preparing for Merge Sort 题目描述:给出\(n\)个不同的数\(a_i\),从左到右找出上升的子序列,删除,继续找,直至所有的数被删…
2009-2010 ACM-ICPC, NEERC, Western Subregional Contest 排名 A B C D E F G H I J K L X 1 0 1 1 1 0 1 X 0 X 1 Problem C. Courier's Route 每个城市的度都为偶数,所以满足欧拉回路的条件,因此当n个城市都联通时,肯定有解.所以只需对每个城市进行欧拉, 输出路径的时候,枚举一下城市a和b之间哪个城市是有联系的即可. Problem D. Dales and Hills 求峰顶…
// 深夜补水题,清早(雾)写水文 A. Automatic Door 题意 \(n(n\leq 1e9)\)个\(employee\)和\(m(m\leq 1e5)\)个\(client\)要进门,\(employee\)进门的时刻为\(a,2a,...,.na\),\(client\)进门的时间则由输入数据给定. 这个门很厉害,是个自动门.如果第\(k\)时刻有人要进门,那么它会在第\(k\)时刻打开,在第\(k+d\)时刻再关闭,在\([k,k+d]\)时刻要进门的人都能在这段期间进门.…
2016 NEERC, Moscow Subregional Contest K. Knights of the Old Republic 题意:有一张图,第i个点被占领需要ai个兵,而每个兵传送至该点需要bi的费用.占领第i条边需要其两端点的兵数之和大等于ci.对于已占领的点或边可以免费通行.因此兵达到一个点的手段有传送和沿路走.图上的兵可以在已占领的点.边随意调度. 求占领所有点的最小花费. 思路:将边按ci进行升序排列,对于每条边两端点所在的连通块进行合并,合并细节见代码.这里有一点值得思…