By the Underground or by Foot? Time limit: 1.0 secondMemory limit: 64 MB Imagine yourself in a big city. You want to get from point A to point B. To do that you may move by foot or use the underground. Moving by the underground is faster but you may…
一.题目 acm.wust.edu.cn/problem.php?id=1205&soj=0 二.分析 一元二次方程有三个系数a.b.c,两个根x1.x2,以及d(德尔塔): a.b.c均为实数,以及输出保留6位小数,全部定义为double类型: a.b.c均为0,退出并结束: 方程有两个根,从大到小输出,中间一个空格: 两根相同输出一个即可: 无解输出-1: 多组输入. 三.思路 计算d(德尔塔): d=0,x1=-b/(2*a),输出x1: d>0,x1=(-b+sqrt(d))/(2*…
1205 简单题 有一些小细节 两个站可能不相连 但是可以走过去 #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdlib.h> #include<vector> #include<queue> #include<cmath> using namespace std; #define IN…
题目链接 题意 : 给你一个数,未知进制,然后让你从2到36进制中找出一个最小的进制K,满足给你的这个数作为k进制时能够整除k-1. 思路 : 有一个公式,(a*b^n)mod(b-1)=a: 给定你这个数,当做字符串输入的时候,这个数转化成10进制的结果应该是:a[0]*k^(n-1)+a[1]*k^(n-2)+……+a[n-1]*k^0,然后题目要求的就是这个式子的结果取余(k-1)为0, 经过最开始给出的公式,将该式子化简得(a[0]+a[1]+……+a[n-1])%(k-1),所以只要满…
R - Work scheduling Time Limit:500MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice URAL 1099 Description There is certain amount of night guards that are available to protect the local junkyard from possible junk r…
A centipede has 40 left feet and 40 right feet. It keeps a left slippers and b right slippers under its bed. Every morning the centipede puts on the slippers. It pokes its first left foot under the bed and puts on a random slipper, doing it in one se…
题目大意 构造一条闭合路线,使得路线不能相交,并且走直线的步数小于等于 S,转弯(左转和右转)的步数小于等于 T.(0≤S,T≤1000) 求一条最长的路线 做法分析 注意到,因为要求路线闭合,那么转弯的数量 T 必须大于等于 4,否则无解. 适当 YY 下:只能用偶数个 S 和偶数个 T,不然不可能构成闭合路径.怎么证明,不会... 情况1:S<2 这种情况下,我们不能使用直走的命令,只能通过不断的转弯来实现题目要求的路径,在纸上画了画,大致图形如下: T=4 时:   T=8:没有   T=…
The blocks in the city of Fishburg are of square form. N avenues running south to north and Mstreets running east to west bound them. A helicopter took off in the most southwestern crossroads and flew along the straight line to the most northeastern…
Legendary Teams Contest Time limit: 1.0 secondMemory limit: 64 MB Nothing makes as old as years. A lot of cool contests are gone, a lot of programmers are not students anymore and are not allowed to take part at the contests. Though their spirit is f…
点我看题目 题意  : 这个人在左下角,地铁在右上角,由很多格子组成的地图,每一条边都是一条路,每一条边都是100米.还有的可以走对角线,问你从起点到终点最短是多少. 思路 : 其实我想说一下,,,,,这个题基本都是用DP做的,这是为什么呢?好吧,这要从我最近要刷BFS题开始,于是二货自己很厉害的用BFS做完了,所以就给我推荐了,我其实没看出来能用BFS来做....... //URAL 1119 #include <iostream> #include <stdio.h> #inc…