上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要: 原理不做赘述,仅当记录 #include<bits/stdc++.h> using namespace std; const int maxn = 1010; int g[maxn][maxn]; const int inf = 0x3f3f3f3f; void init(){ for(int i= 阅读全文
posted @ 2022-03-10 15:38 沃特艾文儿 阅读(23) 评论(0) 推荐(0)
摘要: 树的直径 树上最远的两个节点之间的距离 dfs 两次dfs搜索 第一次 任一点开始进行搜索,找到距离最远点 第二次 从第一次最远点开始搜索再次搜索记录最远距离 // // Created by 29273 on 2022-03-07. // dfs 求树的直径 #include "bits/stdc 阅读全文
posted @ 2022-03-10 15:36 沃特艾文儿 阅读(24) 评论(0) 推荐(0)
摘要: selenium自动化测试简单准备 下载驱动器 http://chromedriver.storage.googleapis.com/index.html 下载与谷歌版本相同或最近版本。 chrome版本查看 帮助中查看 导包 from selenium import webdriver 创建浏览器 阅读全文
posted @ 2022-01-09 15:45 沃特艾文儿 阅读(33) 评论(0) 推荐(0)
摘要: 我们需要用到bitset库函数。bitset类型 类似于数组结构,特点是每一位只能由0或者1构成。 定义 bitset < size > b; size是我们指定的大小即位数,按我们所需指定。 使用 使用时我们将整形对其进行赋值即可。 举个栗子,12如果是四位二进制是1100,八位二进制则为0000 阅读全文
posted @ 2021-04-13 16:55 沃特艾文儿 阅读(158) 评论(0) 推荐(0)
摘要: 陈旧的代码,今天竟然翻出来了QAQ,渣渣学校只会让写学生管理系统,贴出来希望对大家有用。 #include <bits/stdc++.h> using namespace std; struct node { char stuNum[10]; //学号 char stuName[10];//姓名 c 阅读全文
posted @ 2021-04-13 14:19 沃特艾文儿 阅读(67) 评论(0) 推荐(0)
摘要: 解 借助优先队列。 钥匙盒的状态是由老师拿走与放回的操作改变的,每一次输入的w, s, c都包含着两个时刻,s和s+c时刻(放回和归还的时间)。 钥匙盒的变化是随着时间从早到晚来改变的,所以遍历操作改变的时候,时间需要从小到大出现。 如果同一时刻既有老师还钥匙又有老师取钥匙,则老师们会先将钥匙全还回 阅读全文
posted @ 2021-04-09 15:39 沃特艾文儿 阅读(23) 评论(0) 推荐(0)
摘要: 解 遍历判断左右与其满足关系 int judge(int x, int y, int z) { return (x < y && x < z) || (x > y && x > z); } // // Created by 29273 on 2021-04-02. // #include "bits 阅读全文
posted @ 2021-04-09 15:21 沃特艾文儿 阅读(19) 评论(0) 推荐(0)
摘要: 解 基本操作,不多说 // // Created by 29273 on 2021-04-02. // #include "bits/stdc++.h" using namespace std; int main() { int n, num = 0; cin >> n; while (n) { n 阅读全文
posted @ 2021-04-09 15:15 沃特艾文儿 阅读(14) 评论(0) 推荐(0)
摘要: 解 遍历输入数据,存在前后不相等的情况就记录。 // // Created by 29273 on 2021-04-02. // #include "bits/stdc++.h" using namespace std; int a[1001]; int res = 1; int main() { 阅读全文
posted @ 2021-04-09 15:12 沃特艾文儿 阅读(22) 评论(0) 推荐(0)
摘要: 解 vector与map结合 map存储数字以及出现个数,利用vector自定义排序函数来排序 // // Created by 29273 on 2021-04-05. // #include "bits/stdc++.h" using namespace std; bool cmp(pair<i 阅读全文
posted @ 2021-04-09 15:07 沃特艾文儿 阅读(23) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 16 下一页