随笔分类 -  日常总结

摘要:一、aria2c 断点续传 安装: sudo apt install aria2 链接下载: aria2c -c https://images2018.cnblogs.com/blog/1335258/201807/1335258-20180721082544539-350764426.jpg ht 阅读全文
posted @ 2022-11-28 13:57 Daybreaking 阅读(398) 评论(0) 推荐(0)
摘要:实现函数double Power(double base, int exponent),求base的exponent次方。不得使用库函数,同时不需要考虑大数问题。 示例 1: 输入: 2.00000, 10 输出: 1024.00000 示例 2: 输入: 2.10000, 3 输出: 9.2610 阅读全文
posted @ 2021-01-22 09:36 Daybreaking 阅读(66) 评论(0) 推荐(0)
摘要:1. 给定四个点,判断能否组成正方形 求出任意两点之间的六条边后,从小到大排序。 如果前四条边相等,后两条边相等,且后两条边的长度大于前四条边边,则可以组成正方形。 2. 连通图: 设一个二维几何图形的顶点数为V,划分区域数为Ar,一笔画笔数为B,则有: V+Ar-B=1 (如:矩形加上两条对角线所 阅读全文
posted @ 2020-04-26 13:12 Daybreaking 阅读(616) 评论(0) 推荐(0)
摘要:1 // D题 判平行四边形的个数 忘记了数学方法 2 #include<cstdio> 3 #include<cstdlib> 4 #include<cstring> 5 #include<cmath> 6 #include<algorithm> 7 #include<queue> 8 #incl 阅读全文
posted @ 2020-04-26 13:03 Daybreaking 阅读(262) 评论(0) 推荐(0)
摘要:题目描述 乐羊羊饮料厂正在举办一次促销优惠活动。乐羊羊C型饮料,凭3个瓶盖可以再换一瓶C型饮料,并且可以一直循环下去(但不允许暂借或赊账)。请你计算一下,如果小明不浪费瓶盖,尽量地参加活动。那么,对于他初始买入的n瓶饮料,最后他一共能喝到多少瓶饮料。 输入 输入存在多组测试数据每组测试数据输入一行包 阅读全文
posted @ 2020-01-28 12:21 Daybreaking 阅读(883) 评论(0) 推荐(0)
摘要:在写递归函数的时候,只在最后一层写return,中间的过程没有return,导致结果的丢失。 举个例子 1 LL query(LL i, LL k) 2 { 3 if (sum[i] < k) 4 { 5 return -1; 6 } 7 8 if (con[i].l == con[i].r) 9 阅读全文
posted @ 2019-10-27 21:06 Daybreaking 阅读(518) 评论(0) 推荐(0)
摘要:求出任意两点之间的六条边后,从小到大排序。 如果前四条边相等,后两条边相等,且后两条边的长度大于前四条边边,则可以组成正方形。 例题: 牛客 Forsaken喜欢正方形 题目描述 Forsaken特别喜欢正方形,现在他有二维平面的四个整点。如果四个整点可以直接形成一个正方形,输出"wen"。如果可以 阅读全文
posted @ 2019-10-27 20:57 Daybreaking 阅读(2523) 评论(0) 推荐(1)
摘要:搜索实现最短路 设置一个dis数组,dis[i]代表某点(以原点为例)到 i 点的最短距离。 更新原则: 遍历点u想连的点v,若 dis[u] + edge[u].w dis[x] + w) { dis[to] = dis[x] + w; in[to] = 1; //每当最短路发生变化时,重新将in 阅读全文
posted @ 2019-04-26 22:35 Daybreaking 阅读(101) 评论(0) 推荐(0)
摘要:Draw! Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Draw! Description You still have partial information about the score durin 阅读全文
posted @ 2019-03-14 09:23 Daybreaking 阅读(248) 评论(0) 推荐(0)
摘要:"题目链接" 题意:给定一个有向图,顶点代表水池,入度为零的定点代表水源,等级是1,他们延河道(有向边)冲撞,对于普通的水池来说,题目给定判断它等级的两个准则,问出度为零的那个点的等级是多少。 是一道拓扑排序,每次寻找入度为零的点入队,直到队列为空。 出现的问题: 1. 当时想的主要思路是对的,但是 阅读全文
posted @ 2019-03-12 15:29 Daybreaking 阅读(130) 评论(0) 推荐(0)
摘要:"题目链接" 题意: 给定一个无向图,一个汇集点,问哪一个点是 最关键 的,如果有多个关键点,输出 序号最小 的那个。 因为数据量比较小,所以暴力搜索就行,每去掉一个点,寻找和汇集点相连的还剩几个点,以此确定哪个点是关键点。 自己当时没有做出来,主要是以下几个原因: 比赛时过于浮躁,翻译时不细心,没 阅读全文
posted @ 2019-03-12 15:04 Daybreaking 阅读(139) 评论(0) 推荐(0)
摘要:题目链接 : http://acm.sdibt.edu.cn/vjudge/contest/view.action?cid=2186#problem/C 题意:对于斐波那契数列,每个数都mod m , 问相对应的循环周期是几。 比赛的时候这个题做了一个多小时也没做出来,想过暴力的代码,但是因为看到看 阅读全文
posted @ 2019-03-10 19:26 Daybreaking 阅读(117) 评论(0) 推荐(0)
摘要:Description Let's call the following process a transformation of a sequence of length nn . If the sequence is empty, the process ends. Otherwise, appe 阅读全文
posted @ 2018-10-07 22:07 Daybreaking 阅读(392) 评论(0) 推荐(0)
摘要:Description Student Andrey has been skipping physical education lessons for the whole term, and now he must somehow get a passing grade on this subjec 阅读全文
posted @ 2018-10-07 21:01 Daybreaking 阅读(569) 评论(0) 推荐(0)
摘要:On the way to school, Karen became fixated on the puzzle game on her phone! The game is played as follows. In each level, you have a grid with n rows 阅读全文
posted @ 2018-10-06 10:08 Daybreaking 阅读(280) 评论(0) 推荐(0)
摘要:To stay woke and attentive during classes, Karen needs some coffee! Karen, a coffee aficionado, wants to know the optimal temperature for brewing the 阅读全文
posted @ 2018-10-06 09:42 Daybreaking 阅读(260) 评论(0) 推荐(0)
摘要:Long story short, shashlik is Miroslav's favorite food. Shashlik is prepared on several skewers simultaneously. There are two states for each skewer: 阅读全文
posted @ 2018-10-05 11:22 Daybreaking 阅读(342) 评论(0) 推荐(0)
摘要:You are given a ternary string (it is a string which consists only of characters '0', '1' and '2'). You can swap any two adjacent (consecutive) charac 阅读全文
posted @ 2018-10-04 11:25 Daybreaking 阅读(284) 评论(0) 推荐(0)
摘要:You are given an array of integers. Vasya can permute (change order) its integers. He wants to do it so that as many as possible integers will become 阅读全文
posted @ 2018-10-04 09:30 Daybreaking 阅读(245) 评论(0) 推荐(0)
摘要:Berland shop sells nn kinds of juices. Each juice has its price cici. Each juice includes some set of vitamins in it. There are three types of vitamin 阅读全文
posted @ 2018-10-03 17:36 Daybreaking 阅读(365) 评论(0) 推荐(0)