码迷,mamicode.com
首页 >  
搜索关键字:define    ( 25272个结果
Codeforces 1339D - Edge Weight Assignment (数据结构 - 树)
"Description" 思路 这题总觉得有些想法,但是就是写不出来。看了 "题解" 好久才想明白。(以下均图片来自cf "题解" ) 每个度数大于2的结点都是某些叶子结点的LCA,设这个结点为图中的C。虚线代表从叶子结点到C的路径,把路径上面的边全部合并,看成一条边。 对树进行这样的处理之后,一 ...
分类:其他好文   时间:2020-04-13 14:08:37    阅读次数:80
Codeforces Round #633 div2 A~C
A. Filling Diamonds 题意:给你n个菱形方块,问能构成图示形状的有多少种 题解:自己画几个不难发现答案是n 代码: 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 ...
分类:其他好文   时间:2020-04-13 12:05:06    阅读次数:67
Python 元类
什么是元类 我们知道,实例对象是由类创建的,那么类又是由什么创建的呢? 答案就是元类。 元类基本不会用到,但是就算不用,也应该去熟悉一下概念。 理解类也是对象 在大多数编程语言中,类就是一组用来描述如何生成一个对象的代码段。在Python中这一点仍然成立: class ObjectCreator(o ...
分类:编程语言   时间:2020-04-12 22:58:12    阅读次数:76
CF-281C Rectangle Puzzle(凸包+面积)
题意:https://codeforces.com/problemset/problem/281/C 就存个模板 1 #define IOS ios_base::sync_with_stdio(0); cin.tie(0); 2 #include <cstdio>//sprintf islower ...
分类:其他好文   时间:2020-04-12 22:43:43    阅读次数:72
ICPC Southeastern Europe Contest 2019
B(DP) 最重要的是状态转移对同一阶段的影响, 就像01背包优化为什么要倒叙,但这道题不光要倒叙,还要把这阶段的转移先存起来,最后统一保存 就避免了转移同一阶段相互影响 至于排序,当然希望升级多余的经验越多越好。 #include <bits/stdc++.h> #define RE regist ...
分类:其他好文   时间:2020-04-12 22:14:12    阅读次数:104
定时器之基于模模式的间隔定时
1 #include "ioCC2530.h" 2 3 #define D3 P1_0 4 #define D4 P1_1 5 #define D5 P1_3 6 #define D6 P1_4 7 8 unsigned char count = 0; //长定时累计变量 9 10 /* 端口初始化 ...
分类:其他好文   时间:2020-04-12 20:47:23    阅读次数:95
The 2019 China Collegiate Programming Contest Harbin Site I - Interesting Permutation 思维
```//#include#include#include#include#include#include#include#define int long longusing namespace std;#define rep_1(i,m,n) for(int i=m;i='0'&&ch='0'&&... ...
分类:其他好文   时间:2020-04-12 18:37:46    阅读次数:87
The 2019 China Collegiate Programming Contest Harbin Site A - Artful Paintings 差分约束
``` #include #include #include #include #include #include using namespace std; #define ll long long const int N=1e5+5; const int M=1e5+5; const int IN... ...
分类:其他好文   时间:2020-04-12 18:33:54    阅读次数:59
常用头文件
#include<bits/stdc++.h> #define INF 0x3f3f3f3f #define DOF 0x7f7f7f7f #define endl '\n' #define mem(a,b) memset(a,b,sizeof(a)) #define debug(x) cout<< ...
分类:其他好文   时间:2020-04-12 18:21:13    阅读次数:52
2019-2020 ACM-ICPC Latin American Regional Programming Contest A- Algorithm Teaching 二分图
``` #include #define f first #define s second using namespace std; typedef long long ll; const int N=300005; typedef pair P; int n,tot,t,V; map mp; ma... ...
分类:其他好文   时间:2020-04-12 18:18:38    阅读次数:100
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!