north_h
north_h
全部文章
分类
Acwing(4)
codeforces(9)
SMU-XCPC(21)
数据结构(3)
杂项(1)
牛客OJ(3)
题解(1)
归档
标签
去牛客网
登录
/
注册
north_h的博客
菜鸡上路!
全部文章
(共45篇)
Acwing109场周赛
传送门 A 函数 注意开long long #pragma GCC optimize(2) #pragma GCC optimize(3) #include<bits/stdc++.h> #define IOS ios::sync_with_stdio(false),cin.tie(n...
2023-06-24
0
164
牛客小白月赛74
传送门 A 简单的整除 #pragma GCC optimize(2) #pragma GCC optimize(3) #include<bits/stdc++.h> #define IOS ios::sync_with_stdio(false),cin.tie(nullptr), c...
2023-06-10
0
305
ST表
通俗易懂的博客 ST表是能够在o(nlgn)的预处理情况下,在o(1)的复杂度情况下来求一段区间的最小值和最大值,可以用来求重复贡献对问题答案没有影响的问题 为了减少时间复杂度,可以先预处理出lg2的数组,就不要每次都去用log函数 lg2[0] = -1 //方便求lg2循环数组 for(int ...
2023-06-09
0
182
Educational Codeforces Round 148 (Rated for Div. 2)
传送门 A New Palindrome 就判断回文串中出现的字母种类是不是大于1 #include<bits/stdc++.h> //#define int long long #define fi first #define se second using namespace s...
2023-05-14
0
422
快速幂和快速幂求逆元
快速幂 利用倍增的思想,将o(n)的时间复杂度优化成o(lgn) int ksm(int x,int y,int p) { int res = 1; while (y) { if (y & 1)res = (res * x) % p; x = ...
2023-05-14
0
223
SMU Spring 2023 Contest Round 2
传送门 C Darkness I 这个题就是找出一种放最少几个黑块能全部变黑,我么可以沿着对角线放,先以最小的那一边的正方形用对角线的方法放完,然后再两隔一列放一个,但是要注意向上取整。 #include<bits/stdc++.h> #define int long long #de...
2023-05-14
1
535
SMU Spring 2023 Contest Round 3
传送门 A. 签到啦 排个序每次选最大的 #include<bits/stdc++.h> #define int long long #define endl '\n' #define fi first #define se second using namespace std; ...
2023-05-14
0
176
Codeforces Round 820 (Div. 3)(VP)
传送门 A Two Elevators 注意读题,读懂题目即可,比较两部电梯到达1楼所需要的时间。 #include<bits/stdc++.h> #define int long long using namespace std; const int N = 200010; i...
2023-05-05
0
188
Codeforces Round 826 (Div. 3)(VP)
传送门 A Compare T-Shirt Sizes 简单模拟,分情况讨论即可。 #include<bits/stdc++.h> #define int long long using namespace std; const int N = 100010; void solv...
2023-05-05
0
191
Codeforces Round 868 (Div. 2)
传送门 A A-characteristic 题意就是让我们构造一个序列,是的满足i<j的条件下a[i]*a[j]的值为1的个数满足题目要求,我们其实只用关心1和-1的个数即可,通过个数来计算出有多少对1和-1满足题意,满足题意输出YES结果return即可,如果到最后都不能,就输出NO #i...
2023-04-28
0
170
首页
上一页
1
2
3
4
5
下一页
末页