
ACM训练+实训+大学编程练习
文章平均质量分 53
两年多的ACM生活,带来了太多的感悟,也收获了太多太多,感谢!!!
mrxs
俯身凝视深渊,仰头渴望极光
展开
-
【网络流】 Island Transport HDU - 4280 (双向边)
In the vast waters far far away, there are many islands. People are living on the islands, and all the transport among the islands relies on the ships. You have a transportation company there. So...原创 2018-05-17 19:20:01 · 397 阅读 · 0 评论 -
Dining POJ - 3281(网络流)
Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others.Farmer John has cooked fabulous meals for his cows, but he forgot to check his me...原创 2018-05-16 08:59:49 · 290 阅读 · 0 评论 -
【洛谷】P2765 魔术球问题(网络流)
题目描述«问题描述:假设有n根柱子,现要按下述规则在这n根柱子中依次放入编号为1,2,3,…的球。(1)每次只能在某根柱子的最上面放球。(2)在同一根柱子中,任何2个相邻球的编号之和为完全平方数。试设计一个算法,计算出在n根柱子上最多能放多少个球。例如,在4 根柱子上最多可放11 个球。«编程任务:对于给定的n,计算在n根柱子上最多能放多少个球。输入输出格式输入...原创 2018-05-15 15:20:23 · 307 阅读 · 0 评论 -
(洛谷) P2763 试题库问题(网络流dinic+建图)
题目描述«问题描述:假设一个试题库中有n道试题。每道试题都标明了所属类别。同一道题可能有多个类别属性。现要从题库中抽取m 道题组成试卷。并要求试卷包含指定类型的试题。试设计一个满足要求的组卷算法。«编程任务:对于给定的组卷要求,计算满足要求的组卷方案。输入输出格式输入格式: 第1行有2个正整数k和n (2 <=k<= 20, k<=n<= 1000...原创 2018-05-14 11:40:33 · 552 阅读 · 0 评论 -
Drainage Ditches(网络流入门)
Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 83006 Accepted: 32249 DescriptionEvery time it rains on Farmer John’s fields, a pond forms over Bessie’s fa...原创 2018-05-11 17:07:09 · 1288 阅读 · 0 评论 -
MSP430定时器综合试验
MSP430定时器综合试验1.实验目的: 学会定时器使用。2.实验要求:掌握定时器的定时控制编程。3.实验内容(1)编写键盘扫描程序。(2)编写LED显示程序。(3)用定时器控制8个LED循环显示程序(间隔时间1秒)。(4)编写用键控制LED灯循环方向,按键可以随时切换。。代码如下:#include <msp430x14x.h>#include "...转载 2018-06-29 08:43:46 · 780 阅读 · 0 评论 -
MSP430输入输出接口实验
MSP430输入输出接口实验1.实验目的: 学会对P口的使用。2.实验要求: 利用板上的按键,控制LED显示。3.实验内容(1)编写键盘扫描程序。(2)编写LED闪烁(时间间隔1秒,软件延时)显示程序。(3)编写用每一个键控制两个LED灯发光的程序,按键可以随时切换。代码如下:/********************************************...转载 2018-06-29 08:13:35 · 1842 阅读 · 2 评论 -
MSP430单片机原理及应用 实验
单片机原理及应用 课程实验(二)实验项目:MSP430简单程序设计 实验目的:学会用C语言进行简单程序设计 实验要求:掌握编写排序程序 实验内容: (1)设计一个对8个数据(0-255,任意设置)的由小到大排序程序。 (2)将结果显示在LCD显示器上。 程序代码如下:#include &amp;amp;amp;amp;lt;msp430x14x.h&amp;amp;amp;amp;gt;#include &amp;amp;amp;qu原创 2018-09-02 10:13:09 · 3195 阅读 · 1 评论 -
SDUT数三角形
数三角形 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem Description有多少种方法可以从1,2,3,4,….,n中选出3个不同的整数,使得以它们为三边长可以形成三角形? 比如n=5时有3种方法,即(2,3,4),(2,4,5),(3,4,5)。n = 8时有22种方法。Input...原创 2018-03-14 15:28:44 · 367 阅读 · 0 评论 -
SDUT 序列
序列 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem Description我们来定义这样一种序列,这个序列的第一个数字是n,并且数列中的每一项必须大于等于下一项的二倍(如果存在下一项)。我们想知道满足条件的合法序列有多少个? 比如n = 6 6 6 3 6 2 6 1 6 3 1 6...原创 2018-03-14 15:14:11 · 342 阅读 · 0 评论 -
SDUT Time
Time Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem DescriptionDigital clock use 4 digits to express time, each digit is described by 3*3 characters (including”|”,”_”and” “)...原创 2018-03-14 15:01:39 · 317 阅读 · 0 评论 -
C - Naughty Stone Piles(思维)
There are n piles of stones of sizes a1, a2, …, an lying on the table in front of you.During one move you can take one pile and add it to the other. As you add pile i to pile j, the size of pile j i原创 2018-01-25 09:53:22 · 514 阅读 · 0 评论 -
SVN的搭建
《SVN服务器搭建手册》一.下载和搭建SVN服务器:现在Subversion已经迁移到apache网站上了,下载地址:网址:http://subversion.apache.org/packages.html 这是二进制文件包的下载地址,你可在左侧的导航栏找到源代码,文档的下载地址.windows操作系统下面的二进制文件包一共有5种,如图:个人认为最好用Vi原创 2018-01-07 20:32:36 · 289 阅读 · 0 评论 -
M. Quadcopter Competition
M. Quadcopter Competition time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard outputPolycarp takes part in a quadcopter competition. According原创 2017-11-15 09:36:43 · 376 阅读 · 0 评论 -
F - Four Operations(考虑全面)
Little Ruins is a studious boy, recently he learned the four operations!Now he want to use four operations to generate a number, he takes a string which only contains digits ‘1’ - ‘9’, and split it int原创 2017-11-03 14:23:54 · 932 阅读 · 0 评论 -
B - More Cowbell
Kevin Sun wants to move his precious collection of n cowbells from Naperthrill to Exeter, where there is actually grass instead of corn. Before moving, he must pack his cowbells into k boxes of a fixed原创 2017-11-01 21:02:09 · 568 阅读 · 0 评论 -
CodeForces - 548B(补题)
Mike and some bears are playing a game just for fun. Mike is the judge. All bears except Mike are standing in an n × m grid, there's exactly one bear in each cell. We denote the bear standing in column原创 2017-10-24 09:51:35 · 550 阅读 · 0 评论 -
1031. Hello World for U (20)
Hello World for U (20)Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, “helloworld” can be printed as:h d e l l r lowoThat is, the c原创 2017-12-08 09:07:38 · 284 阅读 · 0 评论 -
1009. Product of Polynomials (25)
Product of Polynomials (25)This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each li原创 2017-12-06 19:26:44 · 201 阅读 · 0 评论 -
1008. Elevator (20)
Elevator (20)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. I原创 2017-12-06 17:40:48 · 215 阅读 · 0 评论 -
1007. Maximum Subsequence Sum (25)
Maximum Subsequence Sum (25)Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 <= i <= j <= K. The Maximum Subsequence is the conti原创 2017-11-17 09:35:28 · 286 阅读 · 0 评论 -
**1006. Sign In and Sign Out (25)**
1006. Sign In and Sign Out (25)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records原创 2017-11-15 09:52:01 · 397 阅读 · 0 评论 -
1005. Spell It Right (20)
Spell It Right (20)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one原创 2017-11-15 09:07:15 · 225 阅读 · 0 评论 -
1001. A+B Format (20)(PAT)
A+B Format (20)Calculate a + b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).InputEach input fil原创 2017-11-14 18:24:44 · 335 阅读 · 0 评论 -
7-4 城市间紧急救援
7-4 城市间紧急救援(25 分) 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上。当其他城市有紧急求助电话给你的时候,你的任务是带领你的救援队尽快赶往事发地,同时,一路上召集尽可能多的救援队。输入格式:输入第一行给出4个正整数N、M、S、D,其中N(2≤...原创 2018-03-24 15:29:34 · 501 阅读 · 0 评论 -
A. Generate Login(string)
A. Generate Login(string)time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The preferred way to generate user login in Polygon is to conca原创 2018-01-24 19:57:24 · 498 阅读 · 0 评论 -
D - Buy Low Sell High(multiset)
You can perfectly predict the price of a certain stock for the next N days. You would like to profit on this knowledge, but only want to transact one share of stock per day. That is, each day you will转载 2017-12-11 20:09:40 · 557 阅读 · 0 评论 -
Lweb and String(set)
Lweb and StringTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1301 Accepted Submission(s): 659Problem Description Lweb has a string S.Oned原创 2017-08-16 10:06:52 · 335 阅读 · 0 评论 -
Where is the Marble?
Where is the Marble?C++ 与STL 入门之一: 1.lower_bound(a, a+n, x); 2.sort(a, a+n);#include <bits/stdc++.h>using namespace std;int a[12121211];int main(){ int n, m; int c = 1, x; while(scanf原创 2017-06-03 21:25:24 · 345 阅读 · 0 评论 -
B - The Blocks Problem
B - The Blocks Problemget:1.vector:vector<int>a;//声明a.size();//读取数组大小a.resize();//改变数组大小a.push_back();//向尾部添加一个元素a.pop_back();//删除最后一个元素a.clear();//清空a.empty();//判断是否为空书上模板代码:#include<iostream>#原创 2017-08-07 20:37:06 · 401 阅读 · 0 评论 -
Escape
Escapethink: 感觉自己差的好多啊,一道并不难的追逐问题,我居然不知道要怎样实现?!~ 题目大意: 有以vp速度个人逃离龙的洞,龙在t小时之后发现,以vd速度追赶,每次追上时,人就会扔一件宝物,然后龙就会原路返回洞中,并用f小时来研究宝物,然后再次等待t小时,追赶人…… ××要注意: 时间,速度,用double !#include <bits/stdc++.h>using na原创 2017-06-13 21:31:59 · 356 阅读 · 0 评论 -
Box
Box 题目大意: 给定六行数据,每一组是长方形的长和宽,判断这六个长方形是否可以组成一个长方体。#include <bits/stdc++.h>using namespace std;struct node{ int x, y;//长和宽}t[12];bool cmp(const node &a, const node &b){ if(a.x==b.x) return原创 2017-06-09 20:47:07 · 305 阅读 · 0 评论 -
Crossword Answers
Crossword Answers Think: 题目大意是一个棋盘里有黑色和白色的白块,如果一个白色的白块的左边或者上边是黑色的或者是边界,则白块被标记,序号从左到右,从上到下,依次增大。 然后遍历,遇到序号,把序号和这个白块到边界或者黑块之间的字符输出。遍历是先横后纵。 %%%注意,这题的坑点是:(第一组除外)每一组的前面都有一个空白行(遇到了PE,竟不知道哪里错了,找了好久……)!原创 2017-06-05 09:39:08 · 1036 阅读 · 0 评论 -
紫薯---第三章 J - Periodic Strings
A character string is said to have period k if it can be formed by concatenating one or more repetitions of another string of length k . For example, the string ” abcabcabcabc ” has period 3, si原创 2017-04-09 22:05:36 · 440 阅读 · 0 评论 -
M - 昂贵的聘礼(Dijkstra)
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,他原创 2017-09-16 20:18:46 · 547 阅读 · 0 评论 -
2017 ACM/ICPC Asia Regional Shenyang card card card(补题)
As a fan of Doudizhu, WYJ likes collecting playing cards very much. One day, MJF takes a stack of cards and talks to him: let’s play a game and if you win, you can get all these cards. MJF randomly as原创 2017-09-10 20:24:52 · 554 阅读 · 0 评论 -
Pick-up sticks(线段相交)
Pick-up sticks Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 14393 Accepted: 5450Description Stan has n sticks of various length. He throws them one at a time on the floo...原创 2018-04-13 21:53:26 · 484 阅读 · 0 评论 -
Cycling Roads
几何When Vova was in Shenzhen, he rented a bike and spent most of the time cycling around the city. Vova was approaching one of the city parks when he noticed the park plan hanging opposite the centra...原创 2018-04-13 16:39:48 · 433 阅读 · 0 评论 -
Area(Pick)
Area Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7064 Accepted: 3031Description Being well known for its highly innovative products, Merck would definitely be a good target f原创 2017-12-13 17:39:33 · 306 阅读 · 0 评论 -
Kefa and Company (排序+尺取)
Kefa wants to celebrate his first big salary by going to restaurant. However, he needs company.Kefa has n friends, each friend will agree to go to the restaurant if Kefa asks. Each friend is charact原创 2018-01-26 10:29:49 · 860 阅读 · 0 评论