摘要: 一 kkt 1: [https://www.cnblogs.com/liaohuiqiang/p/7805954.html] 2: [https://www.zhihu.com/search?type=content&q=kkt] 二 PCA 1: [http://blog.codinglabs.o 阅读全文
posted @ 2019-07-08 11:35 xidian_mao 阅读(223) 评论(0) 推荐(0) 编辑

2021年9月5日

摘要: 第五题 抽卡游戏,n张普通卡,m张ssr,抽到ssr花费2金币不放回,抽到普通卡1金币放回,求取完所有ssr的期望金币数 1 #include <iostream> 2 using namespace std; 3 double ans; 4 int main() 5 { 6 int n, m; c 阅读全文
posted @ 2021-09-05 22:00 xidian_mao 阅读(4473) 评论(7) 推荐(0) 编辑

2021年9月3日

摘要: 题目 给定三个正整数a, b, c 请找到满足下面条件的x,y的组数 1, a <= x^2 <=b 2, a <= y^3 <= b 3, |x^2 - y^3| <= c 其中 1 <= a <= b <= 1e18 0 <= c <= 1e18 代码 #include <bits/stdc++ 阅读全文
posted @ 2021-09-03 20:25 xidian_mao 阅读(1217) 评论(0) 推荐(1) 编辑

2021年7月23日

摘要: 快排两路划分(洛谷最后一个例子超时) void quick_sort(int* a, int l, int r) { if(l>=r) return; int ml = l+1, mr = r, key=a[l]; while(true){ while(ml<=r&&a[ml]<=key) ml++ 阅读全文
posted @ 2021-07-23 11:57 xidian_mao 阅读(147) 评论(0) 推荐(0) 编辑

2021年7月14日

摘要: 题目描述 题目分析 其中 s.length < 25, 可以用枚举暴力来做 BFS一层一层枚举,这一层出现正确结果break 1 from collections import deque 2 3 class Solution: 4 def removeInvalidParentheses(self 阅读全文
posted @ 2021-07-14 17:43 xidian_mao 阅读(58) 评论(0) 推荐(0) 编辑

2021年7月8日

摘要: 1 # Definition for a binary tree node. 2 # class TreeNode: 3 # def __init__(self, val=0, left=None, right=None): 4 # self.val = val 5 # self.left = le 阅读全文
posted @ 2021-07-08 20:58 xidian_mao 阅读(43) 评论(0) 推荐(0) 编辑

2021年6月25日

摘要: 1 树的子结构 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class So 阅读全文
posted @ 2021-06-25 17:30 xidian_mao 阅读(43) 评论(0) 推荐(0) 编辑

2021年5月31日

摘要: 题目: 判断数字x在有序数组出现的次数 1 class Solution { 2 public: 3 int GetNumberOfK(vector<int> data ,int k) { 4 if(!data.size()) return 0; 5 cout << upper_bound(data 阅读全文
posted @ 2021-05-31 16:03 xidian_mao 阅读(73) 评论(0) 推荐(0) 编辑

2021年5月28日

摘要: 手写最大堆-实现 1 class Heap { 2 public: 3 void push(int x){ 4 heap.push_back(x); 5 size += 1; 6 int now = size; 7 while(now!=1) { 8 int parent = now / 2; 9 阅读全文
posted @ 2021-05-28 10:02 xidian_mao 阅读(65) 评论(0) 推荐(0) 编辑

2020年11月19日

摘要: 文件后缀“.cpp” 提交选择“G++”编译器 8 1 #include<stdio.h> 2 int num[100]; 3 int main() 4 { 5 int x; 6 int cnt = 0; 7 scanf("%d", &x); 8 while(x) { 9 num[++cnt] = 阅读全文
posted @ 2020-11-19 22:10 xidian_mao 阅读(459) 评论(0) 推荐(0) 编辑

2020年8月6日

摘要: 最近参加字节的笔试,发现好多不会啊,还是缺乏锻炼。 组合数学链接 阅读全文
posted @ 2020-08-06 10:40 xidian_mao 阅读(196) 评论(0) 推荐(0) 编辑