- 博客(62)
- 资源 (1)
- 收藏
- 关注
原创 anaconda navigator ‘bytes‘ object has no attribute ‘get‘ 报错解决
解决方案:把环境变量path中自己添加的%Java_Home%\bin;%Java_Home%\jre\bin删除。通过上述链接成功解决了该报错,之前重装了好几次,但是用着用着就又启动不了了。
2024-03-06 13:05:25 502 1
原创 OpenCV can’t augment image: 608 x 608
python 3.9.18下运行yolo v4,报错OpenCV can’t augment image: 608 x 608。解决方法:opencv-python包降版本,pip install opencv-python==3.4.14.51。在3.4.14.51之前的包不支持python3.9,可以访问。找到跟自己python相配的版本。
2023-12-19 19:47:37 687
原创 OIDv4 运行 convert_annotations.py 报错解决方案
根目录下classes.txt中类名中不能含有下划线,例如Vehicle_registration_plate,要将其改为Vehicle registration plate。
2023-12-19 14:20:04 414
原创 Graphviz报错解决方案
的Graphviz版本不兼容(系统指向的Graphviz版本过高,为7.1.0版本)将其添加到系统变量中,在cmd中输入dot -V验证是否安装成功。解决方案:下载2021年发布的2.44.1版本。重启idea,重新运行代码发现不再报错。报错原因:Graphviz的。
2023-03-16 20:57:11 603 1
原创 java -cp详解(ChatGPT生成)
在实际使用中,根据实际情况需要指定不同的classpath路径和MainClass类名。例如,假设MainClass类位于。是包含main方法的Java类的全限定类名,它的执行将作为Java程序的入口点。是Java类文件所在的目录或jar包文件路径,多个路径之间用。两个jar包文件作为classpath路径。如果MainClass类包含在名为。
2023-03-16 16:02:51 12810
原创 Navicat 连接 阿里云MySQL失败
失败报错:2002 can't connect to service问题描述:在cmd窗口中 telnet+公网地址+22端口 成功,telnet+公网地址+3306(或其他端口)均不成功; 阿里云安全组中已添加了3306端口,但navicat连接始终失败解决方案:用了两个晚上终于把这个问题解决了(哭排查了网上的各种原因:(1)登录用户权限不足:发现root对应的host确实是%(2)云防火墙未关闭:发现防火墙始终是未开启状态(3)bind-address设置为0.0.0.0……
2022-05-03 23:51:10 1776
原创 利用debug工具将exe文件转换为com文件
首先,配置DOSBox+masm虚拟环境,参考:xp中dosbox+masm环境的配置(自用)_stdlibLOL的博客-CSDN博客)准备一个简单的汇编程序,参照该博客提供的com代码,稍作修改:简易com病毒分析_孑曦曦孑的博客-CSDN博客.model smallprogram segment assume cs:program, ds:program, ss:program, es:program org 0100h main proc near
2022-04-02 09:42:56 621 1
原创 编译原理:C++构造简单的LL(1)语法分析器
以下为个人实验代码,肯定有疏忽遗漏之处,欢迎大家一起交流探讨www~ 参考资料:编译原理实验二:LL(1)语法分析器 - Chris-Zhang - 博客园项目文件:main.cpp,LLdefine.h,LLfun.cpp项目源代码详见资源:LLone.zip(简单的LL(1)语法分析器)-C/C++文档类资源-CSDN下载程序功能:用户输入文法,消除直接左递归(不包括间接左递归),计算FIRST和FOLLOW集,生成分析表,判断用户输入句子是否符合文法。运行结果:Pleas..
2021-12-14 17:47:56 3632
原创 Windows下配置Snort报错Unable to open the IIS Unicode Map file解决方法
在Snort安装目录文件夹etc下,修改文件snort.conf找到下面这段内容,将preprocessor http_inspect中unicode.map的全路径给出# HTTP normalization and anomaly detection. For more information, see README.http_inspectpreprocessor http_inspect: global iis_unicode_map unicode.map 1252 compress
2021-12-02 11:17:49 795
原创 PAT甲级 1082(C++)
好久没刷PAT了,终于把这道搁置的题解决了Q_Q测试点三要考虑的是一个0的问题,即输入0或-0,应该输出ling或Fu ling主要思路:将输入字符串4个分为一组输出。如果遇到第一个0,则将zero_flag置为1,直到遇到下一个非0元素,再将zero_flag置为0。zero_flag为1期间,不对字符串内容进行统计,当zero_flag由1变为0时,将ling加入待输出的字符串(可以避免800输出ba Bai ling,避免100800输出yi shi ling Wan ba Bai ling,
2021-11-30 16:29:18 443
原创 PAT甲级 1081(C++)
看了好几篇博客,终于AC了参考:1081. Rational Sum (20)-PAT甲级真题 – 柳婼 の blog浙大 PAT 甲级 1081 Rational Sum 分数运算 排错清单 错误原因_马铃薯小弟的博客-CSDN博客pat-1081Rational Sum(20)(分数运算之注意细节系列)_欢迎访问方偲的博客-CSDN博客总结一下个人遇到的错误:1、一开始没将输入数据设置为long long型2、没有特殊处理整数部分为0,分子部分也为0的情况3、测试点3错误,在每.
2021-11-05 16:32:24 605
原创 PAT甲级 1080(C++)
意外的不难,就是要求有点多#include<iostream>#include<vector>#include<algorithm>using namespace std;struct stu { int no; float Ge, Gi, ave; int prefer[5]; int rank;};int N, M, K;vector<int>quota;vector<stu>info;vector<stu
2021-11-05 15:31:54 95
原创 PAT甲级 1079(C++)
测试点2、3、5没过问题:网上调查之后发现,用float计算结果精度不够,改成double就好了测试点6一开始超时了,当时代码:#include<iostream>#include<math.h>#include<vector>using namespace std;vector<int>father;vector <int> is_retailer;int times;double sum;double price, ra
2021-11-02 20:42:53 442
原创 PAT甲级 1078(C++)
关于测试点1:给定的Msize可能小于2,在这种情况下,最小质数从2开始考虑#include<iostream>#include<math.h>#include<vector>using namespace std;vector<int>hash_t;int getPrime(int N) { int i; while (1) { if (N < 2) N=2; for (i= 2; i <= (int)sqrt(N);
2021-11-02 16:39:21 390
原创 PAT甲级 1077(C++)
还挺容易的这题(开心#include<iostream>#include<string>using namespace std;int main() { string n; getline(cin, n); int N = stoi(n); string result; getline(cin, result); for (int i = 2; i <= N; i++) { string temp; getline(cin, temp); in
2021-11-02 11:53:41 122
原创 PAT甲级 1076(C++ 可以用DFS)
测试点一、四一直过不去,想了挺久,终于对了设一个flag数组,用于存放dfs访问这个结点时,所处的层数。如果再次访问到这个结点,层数<flag数组中存放的值,说明可以遍历到之前没遍历到的后续结点;如果层数>=flag数组中存放的值,说明遍历不到后续未被遍历过的结点,直接跳过。#include<iostream>#include<unordered_set>#include<vector>using namespace std;vector&l
2021-11-01 22:12:02 195 1
原创 PAT甲级 1075(C++)
注意这句话:For those who has never submitted any solution that can pass the compiler, or has never submitted any solution, they must NOT be shown on the ranklist.意思是 提交都没通过编译 和 没提交任何题目 的人不出现在排名表中,因此不能仅通过总分是否为0来判断(可能有人通过编译了但答案一个都不正确,总分为0#include<...
2021-11-01 20:07:11 109
原创 PAT甲级 1074(C++)
#include<iostream>#include<vector>using namespace std;#define maxn 100000struct node { int address; int next; int data;};node info[maxn];int main() { int root, N, K; cin >> root >> N >> K; for (int i = 1; i <=.
2021-11-01 19:17:09 88
原创 PAT甲级 1073(C++)
一次就AC,太好了!!!#include<iostream>#include<string>using namespace std;int main() { string sc; cin >> sc; int pos = 1; string result = ""; string number = ""; int index = 0; if (sc[0] == '-') result += '-'; while (sc[index] != '
2021-10-31 15:52:00 78
原创 PAT甲级 1072(C++)
今天上午写代码的时候有点困,结果这道题改了好久(赋值等号两边写反了竟然所以还是要早点睡觉 @-@我用的弗洛伊德最短路径算法,改了半天测试点4过不去,代码如下:#include<iostream>#include<vector>#include<string>using namespace std;#define inf 1e5vector<vector<int>>d;int main() { int N, M, K, D
2021-10-31 15:20:39 159
原创 PAT甲级 1071(C++)
最后一个测试点过不去,看了这篇:【PAT甲级】1071 Speech Patterns (25分)_SpicyChicken的自我修养-CSDN博客发现我代码的bug和这里面的一模一样哈哈while循环结束后,word里可能还存储了一个单词,把它加进去就好了,用if语句判断一下:if(word.size()!=0) info[word]++;完整代码:#include<iostream>#include<map>#include<string&g
2021-10-30 21:08:25 141
原创 PAT甲级 1070(C++)
关于测试点2:一开始amount我设的是int型,测试点2错误,看了网上的答案,把int改成float就对了(被给的example坑到了,没想到可以为小数#include<iostream>#include<vector>#include<algorithm>using namespace std;struct mk { float amount; float price; float per;};bool compare(mk m1, mk m2
2021-10-30 19:55:36 92
原创 PAT甲级 1069(C++)
挺简单的,哈哈#include<iostream>#include<vector>#include<algorithm>#include<math.h>using namespace std;int main() { int N; scanf("%04d", &N); while (1) { vector<int>part(4, 0); int count = 0; while (N != 0) { p
2021-10-30 19:12:27 90
原创 PAT甲级 1068(C++)
可以套用01背包问题,参考学习资料:【动态规划】01背包问题 - 弗兰克的猫 - 博客园这道题中,输入的数字的值既是它的weight,也是它的value,背包限重是M,背包所装价值(选中数字value的总值)等于背包的重量(数字weight的总值),因此最后可以用dp[N][M]是否为M来判断有没有解,如果没有解的话,即背包限重装不满,价值达不到M。之前也做到过动态规划的题,但遇到这题还是不会,学习算法和修改代码花了很多时间 (泪代码参考:1068. Find More Coins (30)-P
2021-10-28 23:36:10 177
原创 PAT甲级 1067(C++)
确实没思路,参考了下面的算法:【题意+分析】1067 Sort with Swap(0, i) (25 分)_24行代码AC_来老铁干了这碗代码的博客-CSDN博客但是for循环中这一段有点看不懂:if(pos[i] != i) { while(pos[0] != 0) { swap(pos[0], pos[pos[0]]); cnt++; } if(pos[i] != i) { swap(pos[0], pos[i]); cnt++; }
2021-10-28 19:52:42 116
原创 PAT甲级 1066(C++)
对二叉树不太熟悉,看了这个大佬的代码:1066. Root of AVL Tree (25)-PAT甲级真题_柳婼 の blog-CSDN博客然后依葫芦画瓢写了一遍,里面用了很多递归,对指针的使用也要慎重思考(要不要用引用之类的……),相关的练的多了,应该就不用再花这么多时间考虑了。这题以后还要再看看,重新写写。#include<iostream>using namespace std;struct node { int e; node* left; node* right;
2021-10-27 17:09:39 98
原创 PAT甲级 1062(C++)
#include<iostream>#include<vector>#include<string.h>#include<algorithm>using namespace std;struct person { char id[9]; int virtue; int talent;};int N, L, H;vector<struct person>classes[4];bool compare(struct perso.
2021-10-26 21:04:05 74
原创 PAT甲级 1061(C++)
一开始题目理解错了,以为判断星期和小时的字母可以错开来,没想到下标也必须一样#include<iostream>using namespace std;int result[3];string week[7] = { "MON","TUE","WED","THU","FRI","SAT","SUN" };int main() { string a[2],b[2]; cin >> a[0] >> a[1] >> b[0] >> b[
2021-10-25 11:38:11 90
原创 PAT甲级 1060(C++)
自己写的代码,发现最后一个测试点过不去看了这个链接:PAT甲级 1060 Are They Equal (25 分) 题解及几个测试用例_程勇uestc的博客-CSDN博客添加了 if(flag==1) index[i] = dot - count; 中的if判别,顺利通过测试点 5 0 00.0,成功AC(乐#include<iostream>using namespace std;string reserve[2];int index[2] = { 0 };int ..
2021-10-25 10:38:30 165
原创 PAT甲级 1059(C++)
两个注意要点:1、从小到大找符合的prime2、如果输入1,输出1=1#include<iostream>#include<map>#include<math.h>using namespace std;map<int, int>result;int judgePrime(int n) { for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0) return 0; }
2021-10-24 13:58:48 907
原创 PAT甲级 1058(C++)
这题挺简单的,一遍就AC了#include<iostream>using namespace std;int number1[3]; int number2[3];int result[3] = { 0 };int main() { scanf("%d.%d.%d", &number1[0], &number1[1], &number1[2]); scanf("%d.%d.%d", &number2[0], &number2[1], &a
2021-10-24 13:13:34 1514
原创 PAT甲级 1057(C++)
自己写的代码测试点2、3、4一直超时,参考了别人的代码发现要用树状数组(学到了代码参考:1057. Stack (30)-PAT甲级真题(树状数组)_柳婼 の blog-CSDN博客_pat甲级柳树状数组学习参考:树状数组 数据结构详解与模板(可能是最详细的了)_bestsort-CSDN博客_树状数组树状数组简单易懂的详解_FlushHip-CSDN博客_树状数组如果下限定为0的话,同样的代码报错,定为1就不报错了,原因还要思考思考(估计和树状数组特性有关姑且是这题通过了,但是原理还是
2021-10-24 11:31:58 105
原创 PAT甲级 1056(C++)
题目一开始没看懂,看了这个思路:看完思路后自己写的代码一次就AC了,开心#include<iostream>#include<queue>using namespace std;int weight[1000];int ranking[1000];int order[1000];queue<int>compete;int main() { int Np, Ng; cin >> Np >> Ng; for (int i
2021-10-23 17:57:06 32
原创 PAT甲级 1055(C++)
把cin\cout改成scanf\printf,把string改成char[9],增加剪枝部分,同时不存储结果,直接输出终于过了(累代码参考:【附超时原因】1055 The World‘s Richest (25 分)_42行代码AC_来老铁干了这碗代码的博客-CSDN博客自己改好的代码:#include<iostream>#include<vector>#include<algorithm>#include<string.h>usi
2021-10-23 14:13:56 65
原创 PAT甲级 1054(C++)
本来想创个大数组的,一狠心创了个int color[(int)1e9],结果根本不能创这么多(笑,后来就改成了map#include<iostream>#include<map>using namespace std;map<int, int>color;int main() { int M, N; cin >> M >> N; int max_num = 0; int max_color = -1; for (int i =
2021-10-23 10:41:24 47
原创 PAT甲级 1053(C++)
一次过!好耶!#include<iostream>#include<vector>#include<algorithm>using namespace std;struct node { int no; int weight;};int N, M, S;vector<struct node>tree[101];vector<int>path; int sum=0;int w[101];bool compare(stru
2021-10-22 16:40:33 61
原创 PAT甲级 1052(C++)
测试点4考察的是开始地址为-1的情况,直接添加语句输出0 -1就可以了,不然下面输出chain[0].location的时候会报段错误。PS:一开始没考虑到:(#include<iostream>#include<vector>#include<algorithm>using namespace std;#define maxn 100001struct node { int location; int next; int key;};struc
2021-10-22 16:01:00 112
原创 PAT甲级 1051(C++)
没有参考网上答案,自己想的,稍微改了下小错误就AC了,感动(泪#include<iostream>#include<stack>#include<vector>#include<queue>using namespace std;stack<int>s;vector<int>result;queue<int>in;int M, N, K;int judge() { int number = 0; i
2021-10-22 12:08:21 74
原创 PAT甲级 1050(C++)
#include<iostream>#include<string>#include<vector>#include<algorithm>using namespace std;vector<char>c;int main() { string in; getline(cin, in); string compare; getline(cin,compare); for (auto it : compare)c.push_bac.
2021-10-21 11:18:41 55
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人