wcy_sjtu
wcy_sjtu
全部文章
分类
归档
标签
去牛客网
登录
/
注册
wcy_sjtu的博客
全部文章
(共13篇)
题解 | 合并
区间dp #include <iostream> #include<bits/stdc++.h> #include <vector> using namespace std; int main() { // int a, b; // while ...
2025-10-13
0
33
题解 | 石子游戏
只要a>2b或者a%b==0速胜,否则相减重新迭代 #include <iostream> using namespace std; int main() { // int a, b; // while (cin >> a >> b) { ...
2025-10-13
0
41
题解 | 小红玩纸牌
难点在审题, 每张牌不放回的取出, 用ump+set来存放有序的同色牌, 然后拷贝到vector中比较 #include <bits/stdc++.h> #include <regex> using namespace std; using pii=pair<int,...
2025-08-28
0
45
题解 | 设计LFU缓存结构
自定义Node含时间戳和频率,哈希表加上map来弹出LFU元素(小顶堆也可以) #include <utility> #include <vector> class Solution { struct Node{ int key; in...
2025-08-27
0
30
题解 | 旋转数组的最小数字
根据中右端点大小来判断如何缩减区间,相等时逐个减小 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型vector ...
2025-08-15
0
47
题解 | 数组中的逆序对
归并排序加上辅助数组,双指针快速统计并合并相邻有序数组的元素 #include <functional> #include <vector> const int BASE=1000000007; class Solution { public: /** *...
2025-08-15
0
42
题解 | 圆覆盖
直接按离原点距离排序,然后累加达到S后打印退出。注意用long来存储S,二分的提示可以忽略。 import java.util.*; class Point { int x,y,v; double d; Point(int x,int y,int v) { ...
2025-08-12
0
35
题解 | [JSOI2007]建筑抢修
#include <functional> #include <iostream> #include<bits/stdc++.h> #include <queue> #include <vector> using namespace std...
2025-08-08
0
40
题解 | Sliding Window_单调栈实现O(n)更新
#include <iostream> #include<bits/stdc++.h> #include <vector> using namespace std; int main() { // int a, b; // while (cin ...
2025-08-07
0
41
题解 | 铁道双子的大追捕
#include <bits/types/time_t.h> #include <iostream> using namespace std; int main() { int n, m, k, d, t; cin >> n >> m...
2025-08-06
0
61
首页
上一页
1
2
下一页
末页