假设有一群人买一件东西,东西有固定的价格。如果每个人出 a 元,付完钱后还多余了 x 元;如果每个人出 a-1 元,则还缺 y 元。给定 a,x,y,求参与的人数以及物品的价格。 这个题其实有公式的,我记得老师教过 人数=(x+y)/(a-(a-1)) 钱数=人数*a-x或人数*(a-1)+y #i ...
分类:
其他好文 时间:
2020-07-11 19:44:23
阅读次数:
73
E. K-periodic Garland 题意 给出一个长度为 n 的 01 串,现在规定一个串如果相邻两个 1 的位置相隔为 k ,那么这个串就是好串,现在你可以将某个位置的字符翻转,问最少需要多少次可以把这个串变成一个好串? 思路 本来是练习DP的,但是想着想着跑偏了。 好串格式应该是0000 ...
分类:
其他好文 时间:
2020-07-11 19:33:40
阅读次数:
40
双链表一个节点里面有两个指针,一个指向左边,一个指向右边 不定义头结点和尾结点了 令下标是0的点表示head 令下标是1的点表示tail 邻接表的知识:把每个点的所有邻边全部存下来 邻接表就是n个单链表 head[i]存储第i个点的邻边 1 #include <bits/stdc++.h> 2 us ...
分类:
其他好文 时间:
2020-07-11 19:14:03
阅读次数:
46
嵌入式Linux设备驱动程序:用户空间中的设备驱动程序 Embedded Linux device drivers: Device drivers in user space Interfacing with Device Drivers Device drivers in user space 用 ...
分类:
系统相关 时间:
2020-07-11 13:04:44
阅读次数:
95
postfix # .var会自动转化成如下内容,包括.for fmt.Sprintf("abc %d", 10).var sprintf := fmt.Sprintf("abc %d", 10) 快捷代码: for fori forr method like(快捷键 Ctrl + Space + ...
分类:
其他好文 时间:
2020-07-11 12:46:06
阅读次数:
63
传送门:题目39 题目40 我觉得比较好的题解:https://leetcode-cn.com/problems/combination-sum/solution/hui-su-suan-fa-jian-zhi-python-dai-ma-java-dai-m-2/ 观察发现[2 2 3]、[2 3 ...
分类:
其他好文 时间:
2020-07-11 12:29:36
阅读次数:
68
对于key-value结构的排序第一种:lambda表达式第二种:函数第三种:类对()的重载,仿函数形式#include<iostream>#include<vector>#include<unordered_map>#include<string>#include<algorithm>usingnamespacestd;boolcmp(
分类:
编程语言 时间:
2020-07-11 11:13:38
阅读次数:
112
使用自定义异常 'exception_handle' => 'app\common\exception\ApiHandleException', <?php /** * User: xmz * Date: 2020-07-11 * Time: 01:26 */ namespace app\commo ...
分类:
移动开发 时间:
2020-07-11 10:00:56
阅读次数:
87
牧场的安排 具体见代码: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int mod = 1e8; 5 6 // dp[i][j]:第i行,第j种状态的方案数 7 int n, m ...
分类:
其他好文 时间:
2020-07-10 21:10:53
阅读次数:
63
当超出时 td超出或者div超出 加如下样式 pre { white-space: pre-wrap; /*css-3*/ white-space: -moz-pre-wrap; /*Mozilla,since1999*/ white-space: -pre-wrap; /*Opera4-6*/ w ...
分类:
其他好文 时间:
2020-07-10 19:05:22
阅读次数:
76