
C练习
文章平均质量分 70
Roy_Yuan
直到退役依然很菜的小白
展开
-
Project Euler #1: Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.Find the sum of all the multiples of 3 or 5 below N.Input Forma原创 2014-10-27 23:00:27 · 906 阅读 · 0 评论 -
DFS练习-codevs-1294全排列
1294 全排列时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold题目描述 Description给出一个n, 请输出n的所有全排列 输入描述 Input Description读入仅一个整数n (1<=n<=10) 输出描述 Output Description一共n!行,每行n个用空格隔开的数,表示n的一个全排列。并且按全排列的字典序输出。 样例输入原创 2015-05-20 22:30:21 · 657 阅读 · 0 评论 -
DFS练习-codevs-1116四色问题
1116 四色问题时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold题目描述 Description给定N(小于等于8)个点的地图,以及地图上各点的相邻关系,请输出用4种颜色将地图涂色的所有方案数(要求相邻两点不能涂成相同的颜色)数据中0代表不相邻,1代表相邻 输入描述 Input Description第一行一个整数n,代表地图上有n个点接下来n行,每行n个整数原创 2015-05-20 22:27:39 · 733 阅读 · 0 评论 -
DFS练习-codevs-1010过河卒
1010 过河卒2002年NOIP全国联赛普及组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold题目描述 Description 如图,A 点有一个过河卒,需要走到目标 B 点。卒行走规则:可以向下、或者向右。同时在棋盘上的任一点有一个对方的马(如上图的C点),该马所在的点和所有跳跃一步可达的点称为对方马的控制点。例如上图 C 点上的马可以控制 9 个点(图中原创 2015-05-21 23:29:42 · 620 阅读 · 0 评论 -
DFS练习-codevs-1295N皇后问题
1295 N皇后问题时间限制: 2 s 空间限制: 128000 KB 题目等级 : 黄金 Gold题目描述 Description在n×n格的棋盘上放置彼此不受攻击的n个皇后。按照国际象棋的规则,皇后可以攻击与之处在同一行或同一列或同一斜线上的棋子。n后问题等价于再n×n的棋盘上放置n个皇后,任何2个皇后不妨在同一行或同一列或同一斜线上。 输入描述 Input Description给定棋盘原创 2015-05-20 22:32:23 · 568 阅读 · 0 评论 -
高精度-codevs-3116高精度练习之加法
3116 高精度练习之加法 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 题目描述 Description 给出两个正整数A和B,计算A+B的值。保证A和B的位数不超过500位。输入描述 Input Description 读入两个用空格隔开的正整数输出描述 Output Description 输出A+B的值样例输入 Sample原创 2015-06-18 11:11:40 · 550 阅读 · 0 评论 -
棋盘型动态规划-codevs-1169传纸条
1169 传纸条 2008年NOIP全国联赛提高组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题解 题目描述 Description 小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题。一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊和小轩被安排在矩阵对角线的两端,因此,他们就无法直接交谈了。幸运的是,他们可以原创 2015-06-18 11:04:15 · 831 阅读 · 0 评论 -
高精度-codevs-3117高精度练习之乘法
3117 高精度练习之乘法 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 题目描述 Description 给出两个正整数A和B,计算A*B的值。保证A和B的位数不超过500位。输入描述 Input Description 读入两个用空格隔开的正整数输出描述 Output Description 输出A*B的值样例输入 Sample原创 2015-06-18 11:13:31 · 691 阅读 · 0 评论 -
高精度-codevs-3115高精度练习之减法
3115 高精度练习之减法 时间限制: 1 s 空间限制: 64000 KB 题目等级 : 黄金 Gold 题解 题目描述 Description 给出两个正整数A和B,计算A-B的值。保证A和B的位数不超过500位。输入描述 Input Description 读入两个用空格隔开的正整数输出描述 Output Description 输出A-B的值样例输入 Sample I原创 2015-06-18 11:10:00 · 796 阅读 · 0 评论 -
背包型动态规划练习-codevs-1014装箱问题
1014 装箱问题2001年NOIP全国联赛普及组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold题目描述 Description有一个箱子容量为V(正整数,0<=V<=20000),同时有n个物品(0<n<=30),每个物品有一个体积(正整数)。要求n个物品中,任取若干个装入箱内,使箱子的剩余空间为最小。 输入描述 Input Description一个整原创 2015-05-21 23:34:25 · 850 阅读 · 0 评论 -
棋盘型动态规划-codevs-1219骑士游历
1219 骑士游历 1997年 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 题目描述 Description 设有一个n*m的棋盘(2≤n≤50,2≤m≤50),如下图,在棋盘上有一个中国象棋马。 规定:1)马只能走日字2)马只能向右跳问给定起点x1,y1和终点x2,y2,求出马从x1,y1出发到x2,y2的合法路径条数。输入描原创 2015-06-18 17:04:25 · 883 阅读 · 0 评论 -
BestCoder Round #42-1001Shaking hands
水题。。。 Shaking hands Accepts: 452 Submissions: 583 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) 问题描述今天是Gorwin的生日,所以她举办了一个派对并邀请她的朋友来参加。她将邀请n个朋友,为了方便,Gorwin把他们从1到原创 2015-05-23 20:43:04 · 730 阅读 · 0 评论 -
BFS-POJ-3126-Prime Path
Prime Path Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatus Description The ministers of the cabinet were quite upset by the message from the Chief of Secur原创 2015-08-02 16:29:42 · 494 阅读 · 0 评论 -
BFS-POJ-3984-迷宫问题
迷宫问题 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11333 Accepted: 6784 Description定义一个二维数组: int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0,原创 2015-08-09 16:29:37 · 456 阅读 · 0 评论 -
模拟-FZU-2150-Fire Game
Fire Game Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns).原创 2015-08-09 15:58:50 · 536 阅读 · 0 评论 -
DP-POJ-1015-Jury Compromise
Jury Compromise Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26028 Accepted: 6828 Special Judge DescriptionIn Frobnia, a far-away country, the verdicts in court trials原创 2015-08-06 00:10:44 · 531 阅读 · 0 评论 -
BFS-POJ-3414-Pots
Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11798 Accepted: 4992 Special Judge DescriptionYou are given two pots, having the volume of A and B liters respectivel原创 2015-08-02 20:51:02 · 509 阅读 · 0 评论 -
DFS-POJ-1321-棋盘问题
棋盘问题 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uDescription 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input原创 2015-07-26 20:00:31 · 485 阅读 · 0 评论 -
DFS-POJ-1426-Find The Multiple
Find The Multiple Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uDescription Given a positive integer n, write a program to find out a nonzero multiple m of n whose decim原创 2015-08-02 15:48:44 · 490 阅读 · 0 评论 -
模拟-POJ-3087-Shuffle'm up
Shuffle’m Up Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7486 Accepted: 3444 DescriptionA common pastime for poker players at a poker table is to shuffle stacks of chips. Shu原创 2015-08-02 17:41:47 · 505 阅读 · 0 评论 -
BFS-UVA-11624-Fire!
Problem : Fire!Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze.Given Joe’s locat原创 2015-08-17 19:19:22 · 460 阅读 · 0 评论 -
BFS-HDU-1495-非常可乐
非常可乐Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7526 Accepted Submission(s): 3002Problem Description 大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这原创 2015-08-17 20:23:50 · 598 阅读 · 0 评论 -
BFS-HDU-2612-Find a Way
Find a wayTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6615 Accepted Submission(s): 2189Problem Description Pass a year learning in Hang原创 2015-08-17 21:04:03 · 545 阅读 · 0 评论 -
SPFA邻接表-POJ-1511-Invitation Cards
Invitation Cards Time Limit: 8000MS Memory Limit: 262144K Total Submissions: 22675 Accepted: 7424 DescriptionIn the age of television, not many people attend theater performances. Antiqu原创 2015-10-16 22:27:19 · 756 阅读 · 0 评论 -
Dijkstra-POJ-2502-Subway
Subway Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7504 Accepted: 2440 DescriptionYou have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of get原创 2015-10-18 00:40:51 · 595 阅读 · 0 评论 -
Dijkstra-POJ-1847-Tram
Tram Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 12338 Accepted: 4497 DescriptionTram network in Zagreb consists of a number of intersections and rails connecting some of原创 2015-10-18 19:13:00 · 534 阅读 · 0 评论 -
数位DP-URAL-1057-Amount of Degrees
Amount of Degrees Time limit: 1.0 second Memory limit: 64 MB Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactly K different integer degrees of B. E原创 2015-11-03 23:16:50 · 651 阅读 · 0 评论 -
数位DP-POJ-3252-Round Numbers
Round Numbers Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10811 Accepted: 3974 DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scis原创 2015-11-05 18:57:54 · 505 阅读 · 0 评论 -
其他-HDU-1029-Ignatius and the Princess IV
Ignatius and the Princess IVTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others) Total Submission(s): 22321 Accepted Submission(s): 9335Problem Description “OK, you原创 2015-10-23 14:12:14 · 388 阅读 · 0 评论 -
DP+滚动数组-HDU-1024-Max Sum Plus Plus
Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21290 Accepted Submission(s): 7111Problem Description Now I think you have原创 2015-10-22 22:15:06 · 524 阅读 · 0 评论 -
BFS-hihoCoder-第六十六周-Have Lunch Together
Have Lunch Together 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Everyday Littile Hi and Little Ho meet in the school cafeteria to have lunch together. The cafeteria is often so crowded that two adjacen原创 2015-10-08 17:17:09 · 895 阅读 · 0 评论 -
DP-HDU-1069-Monkey and Banana
Monkey and BananaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10168 Accepted Submission(s): 5285Problem Description A group of researche原创 2015-10-23 13:12:11 · 411 阅读 · 0 评论 -
背包DP-HDU-1114-Piggy-Bank
Piggy-BankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 16734 Accepted Submission(s): 8448Problem Description Before ACM can do anything,原创 2015-10-23 23:11:15 · 463 阅读 · 0 评论 -
DP-HDU-1160-FatMouse's Speed
FatMouse’s SpeedTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12405 Accepted Submission(s): 5446 Special JudgeProblem Description FatMou原创 2015-10-24 15:09:48 · 583 阅读 · 0 评论 -
Dijkstra||Prim-POJ-1797-Heavy Transportation
Heavy Transportation Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 25357 Accepted: 6717 DescriptionBackground Hugo Heavy is happy. After the breakdown of the Cargolifter p原创 2015-10-09 18:39:24 · 596 阅读 · 0 评论 -
DP-HDU-1260-Tickets
TicketsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2082 Accepted Submission(s): 1008Problem Description Jesus, what a great movie! Thou原创 2015-10-24 13:43:34 · 478 阅读 · 0 评论 -
DP-HDU-1257-最少拦截系统
最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 27563 Accepted Submission(s): 10891Problem Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种原创 2015-10-24 14:43:34 · 568 阅读 · 0 评论 -
DP-POJ-1661-Help Jimmy
Help Jimmy Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9631 Accepted: 3121 Description“Help Jimmy” 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台原创 2015-10-24 22:35:28 · 408 阅读 · 0 评论 -
DP-HDU-1087-Super Jumping!Jumping!Jumping!
Super Jumping! Jumping! Jumping!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 28751 Accepted Submission(s): 12841Problem Description Nowa原创 2015-10-23 20:34:38 · 426 阅读 · 0 评论 -
Prim-POJ-2253-Frogger
Frogger Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 31345 Accepted: 10104 DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona F原创 2015-10-08 21:50:07 · 421 阅读 · 0 评论