上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 只有当严格递减的时候才会达到冒泡排序最坏时间复杂度 #include<bits/stdc++.h> using namespace std; #define rep(i,j,k) for(LL i=(j); i<(k); ++i) #define pb push_back #define PII p 阅读全文
posted @ 2020-09-25 13:51 CrosseaLL 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 直接求最少需要多少个火柴就行 #include<bits/stdc++.h> #include<string.h> using namespace std; #define rep(i,j,k) for(LL i=(j); i<(k); ++i) #define pb push_back #defi 阅读全文
posted @ 2020-09-15 09:36 CrosseaLL 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 样例输入 3 crm:2 git:3 game 4 hr 1 crm:2 it 3 crm:1 git:1 game dev 2 git:3 game qa 1 git:2 3 alice 1 hr bob 2 it qa charlie 1 dev 9 alice game alice crm:2 阅读全文
posted @ 2020-09-10 13:14 CrosseaLL 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 分三种情况,0多直接输出0 1多直接输出满足要求的偶数个1 一样多的时候,如果是0是偶数直接输出k/2个0 否则用第一个0替换一个奇数位置的1即可 #include<bits/stdc++.h> #include<string.h> using namespace std; #define rep( 阅读全文
posted @ 2020-09-09 13:26 CrosseaLL 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 使用并查集,当能够使1和n在同一个连通块的时候 就可以退出,又因为是求最长时间,也就是当前这个子生成树的最大边 也就是刚好使得1和n联通时加入的那条边的边权 使用克鲁斯塔尔算法即可 #include<bits/stdc++.h> using namespace std; int ans = 0; v 阅读全文
posted @ 2020-09-08 21:49 CrosseaLL 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 因为每个球最终的相对位置的序号是不变的 而且碰撞可以看成穿过,所以直接可以计算所有的最终位置 和树上的蚂蚁这题很像 #include <bits/stdc++.h> using namespace std; int main(int argc, char** argv) { int n,L,t; c 阅读全文
posted @ 2020-09-08 20:07 CrosseaLL 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 直接模拟 为啥会写出这种又臭又菜的代码 class Solution { public: string modifyString(string s) { s += '?'; string ans=""; for(int i=0; i<s.size()-1; i++){ if(i==0){ if(s[ 阅读全文
posted @ 2020-09-06 14:01 CrosseaLL 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 机器学习派上了用场 #include<bits/stdc++.h> using namespace std; int getsign(long long x){ return x<0?-1:1; } int main(int argc, char const *argv[]) { int n; in 阅读全文
posted @ 2020-08-18 18:56 CrosseaLL 阅读(288) 评论(0) 推荐(1) 编辑
摘要: 在区间范围内统计奇数数目 给你两个非负整数 low 和 high 。请你返回 low 和 high 之间(包括二者)奇数的数目。 示例 1: 输入:low = 3, high = 7 输出:3 解释:3 到 7 之间奇数数字为 [3,5,7] 。 示例 2: 输入:low = 8, high = 1 阅读全文
posted @ 2020-07-26 09:57 CrosseaLL 阅读(196) 评论(0) 推荐(1) 编辑
摘要: 下载数据集和导入包 import sys import os print(os.getcwd()) ! wget https://static.leiphone.com/cat_dog.rar ! unrar x cat_dog.rar import numpy as np import matpl 阅读全文
posted @ 2020-07-22 10:55 CrosseaLL 阅读(696) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页