- 博客(29)
- 收藏
- 关注
原创 记忆化搜索
FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid lo...
2019-04-20 15:46:25 96
原创 5 H
POJ 3984定义一个二维数组: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, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二...
2019-01-29 21:09:15 182
原创 9 F
HDU 1072Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. Th...
2019-01-29 18:01:13 316
原创 8 F
HDU 1016A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the num...
2019-01-29 17:52:49 155
原创 6 H
HDU 1495大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S&lt;101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==...
2019-01-29 17:34:59 278
原创 5 G
UVA 11264Joe 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 location ...
2019-01-29 17:02:20 285
原创 4 J
UVA 410The International Space Station contains many centrifuges in its labs. Each centrifuge will have some number © of chambers each of which can contain 0, 1, or 2 specimens. You are to write a p...
2019-01-29 15:24:49 145
原创 4 G
POJ 3414You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i) empt...
2019-01-29 11:59:24 148
原创 3 J
POJ 1611Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strate...
2019-01-29 10:57:11 177
原创 3 I
POJ 3087A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C...
2019-01-29 10:47:40 149
原创 4 I 高精度算法
UVA 424One of the first users of BIT’s new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers. “Thissu...
2019-01-29 00:05:03 170
原创 5 I
HDU 1576要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 &lt;= n &lt; 9973)和B(1 &lt;= B &lt;= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Input...
2019-01-29 00:04:37 186
原创 6 G
HDU 1241The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that ...
2019-01-28 23:25:39 356
原创 8 I 错排公式
HDU 2068今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;…可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的女生越来越多,我们的野骆驼想都知道她...
2019-01-28 23:06:57 142
原创 8 H
UVA 11264Our dear Sultan is visiting a country where there are n different types of coin. He wants to collect as many different types of coin as you can. Now if he wants to withdraw X amount of money ...
2019-01-28 23:03:00 209
原创 9 I 线段树
HDU 1754很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0&amp;amp;lt;N&amp;amp;lt;=200000,0&amp;amp;lt;M...
2019-01-28 22:56:48 114
原创 9 H
UVA 11389In a city there are n bus drivers. Also there are n morning bus routes and n afternoon bus routes with various lengths. Each driver is assigned one morning route and one evening route. For ...
2019-01-28 22:54:56 298
原创 10 J 单源最短路径
POJ 2387Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she want...
2019-01-28 22:33:54 149
原创 10 I 克鲁斯卡尔
POJ 1287You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect p...
2019-01-28 22:29:04 140
原创 10 G 并查集
HDU 1213Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each...
2019-01-28 22:20:12 90
原创 12 H 加权联通最小
POJ 2031There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are connected, if and ...
2019-01-28 22:13:56 106
原创 12 E
HDU1264Your input is a series of rectangles, one per line. Each rectangle is specified as two points(X,Y) that specify the opposite corners of a rectangle. All coordinates will be integers in the ran...
2019-01-28 22:04:47 221
原创 5 J
题目:Kefa decided to make some money doing business on the Internet for exactly n days. He knows that on the i-th day (1 ≤ i ≤ n) he makes ai money. Kefa loves progress, that’s why he wants to know the...
2019-01-26 13:00:15 167
原创 6 I
题目:Little Petya very much likes gifts. Recently he has received a new laptop as a New Year gift from his mother. He immediately decided to give it to somebody else as what can be more pleasant than g...
2019-01-26 12:54:24 307 1
原创 6 J
题目:The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a ...
2019-01-26 12:47:22 228
原创 第二题
#include <iostream>using namespace std;int main(){ int n, a[100][2], b = 0; cin >> n; for (int t = 0; t < n; t++) { cin >> a[t][0] >> a[t][1]; } for (int t = 0; t...
2018-12-07 22:17:54 140
原创 第七题
int main(){ double a, b=3.1415927,v; while (cin >> a) { v = (4*b*a*a*a)/3; cout <<fixed<<setprecision(3)<< v << end
2018-12-07 22:16:12 78
原创 第六题
使用字符数组,排序后输出。#include<iostream>using namespace std;int main(){ char a[3],b; while(cin>>a) { if (a[0] > a[1]) { b = a[0]; a[0] = a[1]; a[1] = b; } if (a[0] > a[2]) { b = a[...
2018-12-07 22:15:27 124
原创 第一题
哈哈哈哈include<iostream>using namespace std;int main(){ char y[] = { 'a','o','u','i','e','y','A','O','U','I','E','Y' }; char a[101]; cin >> a; for (int i = 0; a[i] != '\0'; i++) { ...
2018-12-07 16:48:30 80
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人