codeforces contest round https
CodeForces 1452E Two Editorials
洛谷传送门 CF 传送门 考虑枚举其中一个区间取 \([i, i + K - 1]\),考虑对于每个 \(j\) 一次性处理出,区间取 \([j - K + 1, j]\) 多产生的贡献(即以 \(j\) 为右端点)。 对于一个 \([l_k, r_k]\),设其与 \([i, i + K - 1] ......
网络分层 http,https,arp
目录 网络分层 分层 OSI七层协议 数据上下变化 其它模型 设备 http 常见状态码 TCP Keep-Alive和HTTP Keep-Alive http 1.0 -> 1.1 -> 2.0 -> 3.0 http 1.0 http 1.1 http 2.0 http 3.0 why quic ......
Toyota Programming Contest 2023#7(AtCoder Beginner Contest 328)
Toyota Programming Contest 2023#7(AtCoder Beginner Contest 328) A. Not Too Hard 题意: 将给定的数列\(a\)中数值小于\(x\)的数累加。 解题思路: 模拟。 代码: #include<bits/stdc++.h> u ......
http、https、tcp三次握手,四次挥手
HTTP、HTTPS和TCP介绍 HTTP(超文本传输协议是一种发布和接收 HTML 页面的方法,被用于在 Web 浏览器和网站服务器之间传递信息。是用于www浏览的一个协议。 HTTPS(超文本传输安全协议) = HTTP + SSL/TSL(安全层),HTTPS 经由 HTTP 进行通信,但利用 ......
nginx / 引发的400 The plain HTTP request was sent to HTTPS port
问题: 使用nginx反向代理并将所有80转到443,访问 https://域名/login 出现问题如下,访问 https://域名/login/ 正常显示,但是点击登录无法发送请求仅仅刷新验证码。求解答 <html> <head> <title> 400 The plain HTTP reque ......
AtCoder Beginner Contest 328 (ABC328)
A. Not Too Hard 模拟。 Code B. 11/11 模拟。 Code C. Consecutive Description 给你一个字符串 \(S\),有 \(Q\) 次询问,每次输入 \(l, r\),求:\([S_l,S_r]\) 区间中有多少个相邻的字符是相等的。 Soluti ......
Kattis - Add or Multiply (Rocky Mountain Regional Contest 2023)
Intro Given a math expression with + or * sign with single digit numbers (1 to 9). Support the following operations: Swap 2 number and evaluate the wh ......
AtCoder Beginner Contest 328
AtCoder Beginner Contest 328) A - Not Too Hard 扫一遍求和。 B - 11/11 枚举,判断。 C - Consecutive 对于相等的 \(a_i=1\), 做一遍前缀和。 D - Take ABC 用一个栈维护即可。 E - Modulo MST ......
AtCoder Beginner Contest 328
A - Not Too Hard (abc328 A) 题目大意 给定\(n\)个数字和一个数 \(x\)。 问不大于 \(x\)的数的和。 解题思路 按找要求累计符合条件的数的和即可。 神奇的代码 #include <bits/stdc++.h> using namespace std; usin ......
AtCoder Beginner Contest 328
A 傻逼题。 B 傻逼题 C 傻逼题 D 不难发现,每次添加一个字符,如果可以当前的答案组成 ABC 就删。然后模拟即可。 E 两种方法。 二进制枚举使用了哪些边。 可以发现有用的状态只有 \(\binom{m}{n-1}\),上限大概 \(10^5\),剩余无用状态过了就行。复杂度 \(O(m2^ ......
git提交或克隆报错fatal: unable to access 'https://github.com/xxx/': Failed to connect to github.com port 443 after 21087 ms: Couldn't connect to server
1.问题原因 报错信息: fatal: unable to access 'https://github.com/xxx/autowrite.git/': OpenSSL SSL_read: Connection was reset, errno 10054 又或者 fatal: unable to ......
The 2023 ICPC Nanjing Regional Contest G,F
G. 背包 我们要是选一个集合出来 并且免除k个宝石的话 我们一定是选最贵的k个宝石免费 这样我们的做法就是对wi排序 然后前面的做背包 后面直接贪心选vi最大的k个 这样是一定包含了最优解的 当然你可以用二分bit 也可以直接维护另一个dp int n,tr1[200010],tr2[200010 ......
Codeforces Round 908 (Div. 2) A-D
Secret Sport 观察到数据不大,直接摁住x和y枚举即可,方案合法当且仅当刚好打若干局,且赢最后一局的人是赢家 #include<bits/stdc++.h> using namespace std; void solve(){ int n; cin>>n; string s;cin>>s; ......
Codeforces Round 887 (Div. 2)
https://codeforces.com/contest/1853 C题感觉很不好写的样子,首先通过打表发现最后答案每次都是+n,那么我们考虑前i个,假如当前的ans+i仍然小于a[i+1],则没有影响,我们依然可以直接往后跳,否则,我们越过了a[i+1],那么我们应当加上i+1,注意,这有可能 ......
Kattis - A Complex Problem (The 2023 ICPC Rocky Mountain Regional Contest)
Intro This was one of the problems I didn't do during the regional contest. One of my teammates solved it. Observation There are few things to note. F ......
Codeforces vp 寄
难度标记: \(\verb!A!\) :傻逼题。 \(\verb!B!\) :看完题解后马上就会了。 \(\verb!C!\) :看完题解后还需要想一会,甚至仍然不会。 + 和 - 表示在同档题中的难度。 Codeforces Round 694 (Div. 1) 最终 \(\rm performa ......
AtCoder Beginner Contest(abc) 322
B - Prefix and Suffix 难度: ⭐ 题目大意 给定两个字符串t和s, 如果t是s的前缀则输出1, 如果是后缀则输出2, 如果都是则输出0, 都不是则输出3; 解题思路 暴力即可; 神秘代码 #include<bits/stdc++.h> #define int l1ng l1ng ......
The 10th Jimei University Programming Contest
外校打星队伍,排名22/450,还算凑合吧。 A. A+B问题 直接枚举进制 #include <bits/stdc++.h> using namespace std; using vi = vector<int>; void solve() { string str; vi a, b, s; ci ......
Codeforces Round 907 (Div. 2) ABCF
Codeforces Round 907 (Div. 2)ABCF A. Sorting with Twos 题意:给你一个数组\(a_1,a_2,...,a_n\),你可以进行以下操作: 选择一个非负整数\(m\),并且\(2^m\le n\) 把\(1\le i \le 2^m\)的元素\(a_ ......
Codeforces Round 903 (Div. 3) ABCDE
Codeforces Round 903 (Div. 3)ABCDE A. Don't Try to Count 题意:复制\(s\)串若干遍,是否能在\(s\)串中找到\(t\)串。 思路:直接暴力,注意不要超限,会MLE // AC one more times // nndbk #includ ......
Codeforces Round 908 (Div. 2)
比赛链接 A. Secret Sport 题解 O(1 * T) 对于一场比赛,结束前谁最后赢就是谁赢 #include <bits/stdc++.h> using namespace std; string s; void solve() { int n; cin >> n >> s; cout ......
Educational Codeforces Round 157 D
tilian 不太会这种题 发现找到一个数就能确定整个序列 然后转而发现 前缀异或和 b1 ^ b2 = a1 b1 ^ b3 = a2 ... 我们发现要是n为偶数时能直接求出b1从而确定整个序列 而为奇数时我们无法确定b1 我们思考拆位之后 如果b1该位为0 算出真实的异或后的0 1 个数 b1 ......
CodeForces 852C Property
洛谷传送门 CF 传送门 NOIP 模拟赛 T1,小清新几何题。 要让选出的点组成的多边形面积最大,就要让正多边形的面积减去选出的点组成的多边形面积最小。而这个面积差可以表示成 \(2n\) 个三角形的面积,即 \(\sum\limits_{i = 0}^{2n - 1} S_{\triangle ......
Math.round(-2019.5)的结果是 -2019
Math.round()函数返回一个数字四舍五入后最接近的整数 如果参数的小数部分大于0.5,四舍五入到相邻的绝对值更大的整数 如果参数的小数部分小于0.5,四舍五入到相邻的绝对值更小的整数 如果参数的小数部分等于0.5,四舍五入到相邻的在正无穷(+∞)方向上的整数。 例: x=Math.round ......
EF报错:Unable to create an object of type 'XXXXXXX'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
这个是在EF迁移的时候报错: 解决方案:修改你的MyDbcontext: 代码如下: public class StoreDbContexttFactory : IDesignTimeDbContextFactory< ‘你的类名’> { public ‘你的类名’CreateDbContext(s ......
Atcoder Beginner Contest 321 G - Electric Circuit 题解 - 状压dp | 指定最低位
为了更好的阅读体验,请点击这里 题目链接:G - Electric Circuit 看到了 \(N\) 的数据范围,因此是显然的状压 dp。 不妨设 \(f_S\) 为仅使用 \(S\) 集合中的所有点,能够连成恰好 \(1\) 个连通块的方案数。\(g_S\) 为仅使用 \(S\) 集合中的所有点 ......
python3 requests 请求https报错: urllib3.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:992)
正文 代码示例: #-*- coding:utf-8 -*- import requests url = "https://tst.com" res = requests.get(url=url, verify=False) print(res.content) 运行就报错: urllib3.exc ......
CodeCraft-21 and Codeforces Round 711 (Div. 2)
CodeCraft-21 and Codeforces Round 711 (Div. 2) A. GCD Sum 题意 定义 \(gcdSum(x)=gcd(x,sum\ of\ digits\ of\ x)\)。 请你输出最小的 \(x\) 满足 \(x\ge n\),且 \(gcdSum(x) ......
AtCoder Beginner Contest(abc) 321
B - Cutoff 难度: ⭐⭐ 题目大意 一场考试有n门成绩, 最终成绩是减去最大值和最小值后的和; 现在给出n-1门成绩, 问最后一门成绩最少为多少可以让总成绩大于等于m; 解题思路 列举第n门成绩由小到大时其他成绩所要满足的条件即可; 神秘代码 #include<bits/stdc++.h> ......
2017 China Collegiate Programming Contest Final (CCPC-Final 2017)
目录写在前面EACKJGI写在最后 写在前面 比赛地址:https://codeforces.com/gym/104207。 以下按照个人向难度排序。 妈的怎么感觉有八十万件杂七杂八的事要做。 受不了了,真想直接消失。 这比大学是一秒也不想上了。 E 签到题,看都没看。 code by dztlb: ......