-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.json
1 lines (1 loc) · 7.22 KB
/
search.json
1
[{"title":"Linux下QQ音乐闪退","url":"/2023/09/05/Linux%E4%B8%8BQQ%E9%9F%B3%E4%B9%90%E9%97%AA%E9%80%80/","content":"LInux下QQ音乐闪退的问题\tUbuntu下安装deb版本的QQ音乐会遇到点击图标闪退的问题,解决方法如下:\n\n在终端使用命令 qqmusic –no-sandbox 即可打开\n\n上面这种方法不能一劳永逸,那么可以修改desktop配置\n在Exec这行添加 –no-sandbox %U\nsudo vim /usr/share/applications/qqmusic.desktop[Desktop Entry]Name=qqmusicExec=/opt/qqmusic/qqmusic --no-sandbox %UTerminal=falseType=ApplicationIcon=qqmusicStartupWMClass=qqmusicComment=Tencent QQMusicCategories=AudioVideo;\n\n 如没有生效则重启\n\n\n","tags":["Linux"]},{"title":"Hello World","url":"/2023/07/13/hello-world/","content":"Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.\nQuick StartCreate a new post$ hexo new "My New Post"\n\nMore info: Writing\nRun server$ hexo server\n\nMore info: Server\nGenerate static files$ hexo generate\n\nMore info: Generating\nDeploy to remote sites$ hexo deploy\n\nMore info: Deployment\n"},{"title":"洛谷P1359 游艇","url":"/2024/01/21/%E6%B4%9B%E8%B0%B7P1359%E7%A7%9F%E7%94%A8%E6%B8%B8%E8%89%87/","content":"租用游艇原题传送门\n题目长江游艇俱乐部在长江上设置了 个游艇出租站 。游客可在这些游艇出租站租用游艇,并在下游的任何一个游艇出租站归还游艇。游艇出租站 到游艇出租站 之间的租金为 ()。试设计一个算法,计算出从游艇出租站 到游艇出租站 所需的最少租金。\n输入格式第一行中有一个正整数 ,表示有 个游艇出租站。接下来的 行是一个半矩阵 ()。\n输出格式输出计算出的从游艇出租站 到游艇出租站 所需的最少租金。\n样例 #1样例输入 #135 157\n\n样例输出 #112\n\n提示,保证计算过程中任何时刻数值都不超过 。\n题解分析\t这是一道求最优解的dp问题。可以用dp[i]来表示要到达第i个出租站所需要的最少租金。则dp[n]就是我们需要的答案。\n\t可以知道dp[1],dp[2]为和,那么之后的每个站点的dp[i]可以知道是:由于本题的数据量小,所以不会超时。\n代码#include <bits/stdc++.h>using namespace std;int n;int r[5000][5000];long long int dp[5000];long long int temp;int main(){ memset(dp,2e6,sizeof(dp)); cin>>n; for (int i = 1;i<n+1;i++){ for(int j=i+1;j<n+1;j++){ cin>>r[i][j]; } } dp[1] = 0; dp[2] = dp[1]+r[1][2]; for(int i = 3;i<=n;i++){ temp = r[1][i]; for(int j = 2;j<i;j++){ temp = min(temp,dp[j]+r[j][i]); } dp[i] = temp; } cout<<dp[n];}\n\n\n\n\n\n\n\n","tags":["算法"]},{"title":"洛谷P1757 分组背包","url":"/2024/01/27/%E6%B4%9B%E8%B0%B7P1757%E5%88%86%E7%BB%84%E8%83%8C%E5%8C%85/","content":"洛谷P1757 分组背包原题传送门\n题目描述自 背包问世之后,小 A 对此深感兴趣。一天,小 A 去远游,却发现他的背包不同于 背包,他的物品大致可分为 组,每组中的物品相互冲突,现在,他想知道最大的利用价值是多少。\n输入格式两个数 ,表示一共有 件物品,总重量为 。\n接下来 行,每行 个数 ,表示物品的重量,利用价值,所属组数。\n输出格式一个数,最大的利用价值。\n样例 #1样例输入 #145 310 10 110 5 150 400 2\n\n样例输出 #110\n\n提示,,, 在 int 范围内。\n题解分析1、将第i组第j个的重量和价格分别存在w[i][j],v[i][j]中。2、在每个组内dp,进行01背包操作。3、最后dp[maxn][V]就是取到第maxn组,背包容量为V的最大价值\n\n从上面可以得知,状态转移方程为:\n代码#include <bits/stdc++.h>using namespace std;int n,m,vi,wi,ci;int n[101],w[101][1001],v[101][1001],dp[101][1001];int maxn = 0;\t int main(){ cin>>m>>n; for (int i = 1;i<=n,i++){ cin>>wi>>ci>>ci; n[ci]++; v[ci][n[ci]] = vi; w[ci][n[ci]] = wi; maxn = max(maxn,ci); } for(int i = 1;i <= maxn;i++){ for(int j = 0;j <= n[i];j++){ for(int k = v; k >= w[i][j];k--){ dp[i][k] = max(dp[i-1][k],dp[i-1][k-c[i][j]]+w[i][j]) } } } cout<<dp[maxn][v];}\n\n","tags":["算法"]},{"title":"洛谷P2735 网","url":"/2024/01/21/%E6%B4%9B%E8%B0%B7P2735%E7%BD%91/","content":"洛谷P2735网原题传送门\n题目描述在本题中,格点是指横纵坐标皆为整数的点。\n为了圈养他的牛,农夫约翰(Farmer John)建造了一个三角形的电网。他从原点(0,0)牵出一根通电的电线,连接格点(n,m)(0<=n<32000,0<m<32000),再连接格点(p,0)(p>0),最后回到原点。\n牛可以在不碰到电网的情况下被放到电网内部的每一个格点上(十分瘦的牛)。如果一个格点碰到了电网,牛绝对不可以被放到该格点之上(或许Farmer John会有一些收获)。那么有多少头牛可以被放到农夫约翰的电网中去呢?\n输入格式输入文件只有一行,包含三个用空格隔开的整数:n,m和p。\n输出格式输出文件只有一行,包含一个整数,代表能被指定的电网包含的牛的数目。\n样例 #1样例输入 #17 5 10\n\n样例输出 #120\n\n题解前置知识PICK定理\n\t公式中a表示多边形内部点的个数,b表示多边形边上点的个数,S表示多边形面积。\n扩展欧几里德\t在两个整点 A(x1,y1)与B(x2,y2)的线段中经过整点的个数为:Tips:\ngcd(x,y)是x与y的最大公因数。\n分析求解\t题目大意就是一个以(0,0)、(p,0)、(n,m)为顶点的三角形内有多少个整点。依据PICK定理,可以得到:而三角形面积可以由公式得到:每条边上的整点个数:\n\n\n所以可以得到答案为:\nint ans = m*p/2-(p+1+gcd(n,m)+1+gcd(abs(n-p),m)+1-3)/2+1\n最终代码#include <bits/stdc++.h>using namespace std;int n,m,p;int gcd(n,m){//辗转相除法 int r; while(n!=0){ r = m%n; m=n; n=r; } return m;}int main(){ scanf(\"%d%d%d\",&n,&m,&p); ptintf(\"%d\",m*p/2-(p+1+gcd(n,m)+1+gcd(abs(n-p),m)+1-3)/2+1); return 0;}\n\n","tags":["算法"]},{"title":"高通9008救砖","url":"/2023/10/05/%E9%AB%98%E9%80%9A9008%E6%95%91%E7%A0%96/","content":"高通9008救砖\t上个月买了台一加7 pro,不仅仅是圆了高中时候的梦想,也是把以前的刷机技术捡回来。以前给摩托罗拉的智能机,联想的手机刷上miui,现在打算给一加刷个老版本的H2OS然后root。不出意外的话就出意外了,手残装了magisk然后又给他bootloader锁上了,手机就这样不出意外的变成砖头了。当我还以为大几百打水漂的时候,发现了高通9008端口刷机这个技巧,只要手机硬件没烂就能救回来。\n1、准备工作\n一台变成砖的手机\n一台没有变成砖的电脑\n一根能传输数据的数据线\n一加官方驱动程序\n高通9008刷机驱动程序\n一加官方9008刷机程序\n\n","tags":["搞机"]}]