摘要: Codeforces Round 898 (Div. 4) A Short Sort 直接枚举许所有情况即可 /* * * Author: north_h * Time: 2023-09-21 22:35:49 * * Problem: A. Short Sort * Contest: Codefo 阅读全文
posted @ 2023-09-22 14:32 north_h 阅读(273) 评论(0) 推荐(1)
摘要: 第一题 #include <stdio.h> #include <time.h> #include <math.h> clock_t start, stop; double duration; #define MAXN 10 #define MAXK 1e7 double f1(int n, dou 阅读全文
posted @ 2023-09-10 22:38 north_h 阅读(27) 评论(0) 推荐(0)
摘要: # [Pinely Round 2 (Div. 1 + Div. 2) - Codeforces](https://codeforces.com/contest/1863) ## A Channel **题意:总共有$n$个人,最开始有$a$个人在线上,再给你$q$次消息,每次消息$+$表示上线,$ 阅读全文
posted @ 2023-08-31 18:36 north_h 阅读(102) 评论(0) 推荐(1)
摘要: # 打cf的时候用unordered_map防止被hack可以重新自定义哈希函数 ## 第一种 ``` struct custom_hash { static uint64_t splitmix64(uint64_t x) { x ^= x > 7; x ^= x > 30)) * 0xbf5847 阅读全文
posted @ 2023-08-30 17:19 north_h 阅读(177) 评论(0) 推荐(0)
摘要: # 线段树 ```c++ struct Node{ int l, r, sum, lazy; }tr[N * 4]; int a[N]; void pushup(int u) { tr[u].sum = tr[u > 1; pushdown(u); build(u = l && tr[u].r > 阅读全文
posted @ 2023-08-24 10:14 north_h 阅读(12) 评论(0) 推荐(0)
摘要: # [AtCoder Beginner Contest 314 - AtCoder](https://atcoder.jp/contests/abc314) ## A 3.14 ```c++ void solve() { string s = "3.1415926535897932384626433 阅读全文
posted @ 2023-08-14 16:22 north_h 阅读(55) 评论(0) 推荐(0)
摘要: # [AcWing116](https://www.acwing.com/activity/content/3405/) ## A AcWing 5134. 简单判断 ```c++ void solve() { int x, y, z; cin >> x >> y >> z; if(x > y + 阅读全文
posted @ 2023-08-13 20:18 north_h 阅读(18) 评论(0) 推荐(0)
摘要: # [Codeforces Round 892 (Div. 2) ](https://codeforces.com/contest/1859) ## A United We Stand **题意:给一个数组,让你把它分成两个数组,第二个数组里的数不能是第一个数组里的数的除数,先输出两个数组的长度,依 阅读全文
posted @ 2023-08-13 19:29 north_h 阅读(116) 评论(0) 推荐(0)
摘要: # [Codeforces Round 764 (Div. 3) ](https://codeforces.com/contest/1624) ## A Plus One on the Subset **题意:判断最大和最小差多少即可** ```c++ void solve() { int n; c 阅读全文
posted @ 2023-08-12 18:35 north_h 阅读(14) 评论(0) 推荐(0)
摘要: # [Codeforces Round 799 (Div. 4)](https://codeforces.com/contest/1692) ## A Marathon ```c++ void solve() { vector a(4); int goal; cin >> goal; int ans 阅读全文
posted @ 2023-08-11 23:23 north_h 阅读(83) 评论(0) 推荐(0)