Traffic Jam in Flower Town 题目链接: http://acm.hust.edu.cn/vjudge/contest/126546#problem/I Description Having returned from Sun City, Dunno told all his friends that every shorty may have a personal automobile. Immediately after that so many citizens to…
2020. Traffic Jam in Flower Town Time limit: 1.0 secondMemory limit: 64 MB Having returned from Sun City, Dunno told all his friends that every shorty may have a personal automobile. Immediately after that so many citizens took a fancy of becoming ro…
题目链接:http://codeforces.com/gym/101775/problem/C 题意: 给出 $N$ 个红绿灯,又给出 $N+1$ 个距离 $S_i = S_0,S_1, \cdots, S_N$,代表从第 $i$ 个路灯到第 $i+1$ 个路灯的距离(第 $0$ 个距离代表从家到第一个红绿灯的距离,第 $N$ 个距离代表从最后一个红绿灯到公司的距离). 现在每个红绿灯有 $A_i$ 秒的绿灯时长,$B_i$ 秒的红灯时长,所有的红绿灯的 $A_i + B_i$ 都相等,你可以通…
题目描述 Jam是个喜欢标新立异的科学怪人.他不使用阿拉伯数字计数,而是使用小写英文字母计数,他觉得这样做,会使世界更加丰富多彩.在他的计数法中,每个数字的位数都是相同的(使用相同个数的字母),英文字母按原先的顺序,排在前面的字母小于排在它后面的字母.我们把这样的“数字”称为Jam数字.在Jam数字中,每个字母互不相同,而且从左到右是严格递增的.每次,Jam还指定使用字母的范围,  例如,从2到10,表示只能使用{b,c,d,e,f,g,h,i,j}这些字母.如果再规定位数为5,那么,紧接在Ja…
题意:给定 n 个裁判,然后每个都一些题目,现在要从每一个按顺序去选出 k 个题,并且这 k 个要按不递减顺序,如果没有,就用50补充. 析:就按他说的来,直接模拟就好. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #…
题意:给定一些动物的叫声,然后再定某些动物的叫声,让你去除这些叫声后得到的叫声. 析:先存储所有的叫声,然后用map来记录其他的叫声,在输出时再判定一下就好. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #includ…
题目链接 题意 : 给出 N 个点(最多 1e6 )和 M 条边 (最多 N + 20 条 )要你输出一条从 1 开始回到 1 的哈密顿回路路径,不存在则输出 " There is no route, Karl! " 分析 :  题意很简单明了 众所周知,哈密顿回路是个 NP-Hard 问题 这么多个点的哈密顿回路肯定是不能暴力去寻找的 但是关注到 M ≤ N + 20 这个特殊的条件 那就说明图中肯定有很多单向链 那么这题就很明确了,就把所有的单链缩成一个点 然后再去 DFS 暴力找…
One-way traffic Time Limit: 3000ms Memory Limit: 131072KB This problem will be judged on UVALive. Original ID: 266464-bit integer IO format: %lld      Java class name: Main   In a certain town there are n intersections connected by two- and one-way s…
Real Life Traffic Time Limit: 2000ms Memory Limit: 32768KB This problem will be judged on LightOJ. Original ID: 129164-bit integer IO format: %lld      Java class name: Main Dhaka city is full of traffic jam and when it rains, some of the roads becom…
One-way traffic In a certain town there are n intersections connected by two- and one-way streets. The town is very modern so a lot of streets run through tunnels or viaducts. Of course it is possible to travel between any two intersections in both w…