去年比赛的时候虽然对了,但写的好麻烦,以至于后面不敢再写这道题,今天又写了一遍,贴出来做纪念。 #include<stdio.h> #include<bits/stdc++.h> using namespace std; #define ll long long #define io_opt ios ...
分类:
其他好文 时间:
2020-10-27 11:46:36
阅读次数:
32
凸包板子 #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using namespace std; struct Point { int x,y; }; Point a ...
分类:
其他好文 时间:
2020-10-27 11:27:51
阅读次数:
20
添加引用: ThoughtWorks.QRCode.dll System.Drawing using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Mi ...
让我们看看如何根据Pandas DataFrame中的某些条件选择行。 使用'>', '=', '=', '<=', '!=' 运算符根据特定的列值选择行。 代码1:使用基本方法从给定数据框中选择'Percentage'大于80的所有行。 # importing pandas import pand ...
分类:
其他好文 时间:
2020-10-26 11:54:35
阅读次数:
30
DP +++ 一.背包问题 1.01背包 二维数组状态转移 #include <iostream> using namespace std; const int N = 1010; int v[N], w[N]; int n, m; int f[N][N]; int main() { cin >> ...
分类:
其他好文 时间:
2020-10-26 11:54:14
阅读次数:
26
C. 前缀和。 #include <bits/stdc++.h> using namespace std; #define maxn 300000 #define INF 10000000 char c[maxn]; int n, ans = INF, sumB[maxn], sumW[maxn]; ...
分类:
其他好文 时间:
2020-10-26 11:41:45
阅读次数:
22
7-9 小字辈: 开始使用并查集暴力做的,结果超时。 正确思路: 用嵌套的vector存储每个人的下一辈有谁,之后记录祖宗,再dfs。 之前学STL的时候没学vector,之前学习的dfs也差不多忘了,通过这道题再复习了一下。 代码如下: #include<bits/stdc++.h> using ...
分类:
其他好文 时间:
2020-10-26 11:18:47
阅读次数:
82
这个题目有好多人倍增求LCA会被卡成80分(包括第一次提交的我,然后,我在万神的教导下,使用了优化版的倍增,直接水过去了.....跑得还挺快,最大点700ms(没有优化前1500ms),好吧其实还是卡过去的,用了快读快写,不过这里优化的倍增求LCA还是值得拿起小本子记录一下的哈哈) Code: #i ...
分类:
其他好文 时间:
2020-10-26 10:36:11
阅读次数:
18
C. 如果S不等于1e9的话,可以直接放上k个S,再把剩下的所有数都写成1e9。如果S等于1e9,那么可以把剩下所有的数都写成1; #include <bits/stdc++.h> using namespace std; #define MAXX 1000000000 int n, S, K; i ...
分类:
其他好文 时间:
2020-10-24 09:45:15
阅读次数:
19
#include <iostream> #include"stdafx.h" #include<vector> #include<map> #include<string> #include<thread> using namespace std; class A { public: int m_i ...
分类:
编程语言 时间:
2020-10-22 23:16:25
阅读次数:
47