
Lightoj
文章平均质量分 80
hzasrd
这个作者很懒,什么都没留下…
展开
-
Lightoj 1078(模拟取余)
这道题其实就是个手动模拟除法的过程,每次对所得余数*10+后面的一位数字重新得到一个数,循环此过程直到整除就行了;#include#include#include#include#include#define N 60using namespace std;int main(){ int t,n,d,k,h; scanf("%d",&t); k=0;原创 2016-07-30 20:07:46 · 435 阅读 · 0 评论 -
lightoj1017 Brush (III) (dp)
1017 - Brush (III) PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBSamir returned home from the contest and got angry after se原创 2017-08-24 09:45:52 · 260 阅读 · 0 评论 -
lightoj 1013 Love Calculator (LCS+dp)
Yes, you are developing a 'Love calculator'. The software would be quite complex such that nobody could crack the exact behavior of the software.So, given two names your software will generate the p原创 2017-08-23 16:27:26 · 317 阅读 · 0 评论 -
lightoj 1011 Marriage Ceremonies (KM模板题)
You work in a company which organizes marriages. Marriages are not that easy to be made, so, the job is quite hard for you.The job gets more difficult when people come here and give their bio-data w原创 2017-08-22 20:59:05 · 280 阅读 · 0 评论 -
lightoj 1009 Back to Underworld (种类并查集)
The Vampires and Lykans are fighting each other to death. The war has become so fierce that, none knows who will win. The humans want to know who will survive finally. But humans are afraid of going t原创 2017-08-22 15:58:40 · 278 阅读 · 0 评论 -
light oj 1008 Fibsieve`s Fantabulous Birthday (规律)
Fibsieve had a fantabulous (yes, it's an actual word) birthday party this year. He had so many gifts that he was actually thinking of not having a party next year.Among these gifts there was an N x原创 2017-08-21 18:47:12 · 244 阅读 · 0 评论 -
light oj 1007 Mathematically Hard (欧拉函数)
Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable.In this problem, you will be given two integers a and b. You have to find the summat原创 2017-08-21 17:27:07 · 230 阅读 · 0 评论 -
light oj 1005 Rooks(组合数)
A rook is a piece used in the game of chess which is played on a board of square grids. A rook can only move vertically or horizontally from its current position and two rooks attack each other if one原创 2017-08-21 15:15:10 · 301 阅读 · 0 评论 -
lightoj1003 Drunk 、uva10305 Ordering Tasks (基于dfs的拓扑排序)
uva10305题意很简单,给你几个任务,这几个任务之间有先做和后做的顺序,如果a,b之间有顺序的话,就必须在做b之前先把a做了,然后问你做这几件事的一个可能的顺序是什么(答案可能不唯一,只要满足要求即可)。这道题很基础的一道拓扑排序,由于数据很小,可以采用矩阵来存储图;关于拓扑排序网上也有很多讲解,感觉dfs这种比较容易理解一点吧,在《算法竞赛入门经典》第二版167页讲解有;#inc原创 2016-09-06 09:18:30 · 414 阅读 · 0 评论 -
lightoj1046 Rider(广搜BFS)
题意:给你一个棋盘,点代表空广场,数字K代表广场上有骑士且骑士每次能跳K步,问是否可以通过移动适当的骑士使得所有的骑士都在一个广场上,如果能,输出最小的移动次数,如果不能,输出-1;模拟加搜索。可以遍历一下棋盘上每个广场,然后让每个骑士都移动到正在遍历的广场上去,记录下所需的步骤,并更新最小步骤,注意应当用广搜来写,用深搜会超时;#include#include#include#in原创 2016-09-06 21:15:34 · 365 阅读 · 0 评论 -
lightoj1134 Be Efficient
这道题属于一个思路题,想不到这块的话那就写不出来;给n个数,问有多少个连续的子段之和能整出某个数m;可以将这个序列的前缀和求出来,再分别对m取余数,如果同一个余数再次出现的话,那么所加的这段数就是m的倍数;比如,2 1 4 3;他们的前缀和为2 3 7 10,分别对4取余数,则为2 3 3 2;当3再次出现的时候,意味着所加的这个子段(从前一个余数3到后一个3,也就是4这段)是4的倍数原创 2016-09-05 15:08:06 · 343 阅读 · 0 评论 -
lightoj1058 && poj1791 求平行四边形个数
DescriptionThere are n distinct points in the plane, given by their integer coordinates. Find the number of parallelograms whose vertices lie on these points. In other words, find the number of 4-原创 2016-08-13 19:39:45 · 432 阅读 · 0 评论 -
lightoj 1369 - Answering Queries (数学、规律、水)
Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu(明确指出64位格式为lld,用I64d会wa!!!)DescriptionThe problem you need to solve here is pretty simple. You are give a functionf(原创 2016-08-18 20:27:04 · 438 阅读 · 0 评论 -
LightOJ 1138(求末尾零个数)
DescriptionYou task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you knowN! = 1*2*...*N. For example, 5! = 120, 120 contains o原创 2016-08-18 20:14:12 · 1492 阅读 · 0 评论 -
LightOJ - 1041 Road Construction(最小生成树)
DescriptionThere are several cities in the country, and some of them are connected by bidirectional roads. Unfortunately, some of the roads are damaged and cannot be used right now. Your goal is t原创 2016-08-17 10:54:03 · 427 阅读 · 0 评论 -
Lightoj 1152 Hiding Gold
藏黄金。先计算出黄金的总共数量,并一一进行编号,从1开始,然后四个方向进行判断,看是否有和黄金相连的另一块黄金,有的话建立一条边,最终形成一个二分图,这个二分图的最大匹配再除2就是公用一块布条的黄金,用黄金总数减去他就是答案了= =#include#include #include #include#include#include#define N 1100using n原创 2016-07-28 21:50:23 · 310 阅读 · 0 评论 -
Lightoj 1198 (KM模板题)
套用KM模板就行了,一道模板题,注意建图就行。#include#include#include#include#include#define N 60using namespace std;int vx[N],vy[N],lx[N],ly[N],link[N],mat[N][N];int n;int dfs(int t){ int i; vx[t]=1;原创 2016-07-30 20:00:09 · 353 阅读 · 0 评论 -
lightoj 1024 - Eid (高精度乘法+n个数的最小公倍数)
1024 - Eid PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBIn a strange planet there are n races. They are completely differen原创 2017-08-28 16:28:16 · 423 阅读 · 0 评论