.定义一个CPU类,包含等级(rank)、频率(frequency)、电压(voltage)等属性,有两个公有成员函数run、stop。其中,rank为枚举类型CPU_Rank,定义为enum CPU_Rank{P1=1,P2,P3,P4,P5,P6,P7},frequency为单位是MHz的整型数 ...
分类:
编程语言 时间:
2020-01-24 18:48:50
阅读次数:
119
「TJOI2019」甲苯先生的滚榜 "传送门" 双关键字感觉不太好搞?直接压成一个 就好了呗。 然后就是平衡树板子了。 参考代码: ...
分类:
其他好文 时间:
2020-01-23 22:41:04
阅读次数:
84
主席树 学了主席树,用来求区间上的第k小 写一下自己整理后的模板 求区间第k小 include using namespace std; //poi2014 const int maxn = 500001; struct node{ int v,lc,rc; }T[maxn 21]; int n,m ...
分类:
其他好文 时间:
2020-01-22 21:37:27
阅读次数:
81
E - Arctic Network The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communica ...
分类:
Web程序 时间:
2020-01-21 23:45:57
阅读次数:
125
题解 模拟水题。 代码 #include<bits/stdc++.h> using namespace std; struct node { string name; int final_rank,loc_num,loc_rank,grade; node(string name,int loc_nu ...
分类:
其他好文 时间:
2020-01-21 13:31:06
阅读次数:
63
A - Cow Contest N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better th ...
分类:
其他好文 时间:
2020-01-21 00:23:35
阅读次数:
73
并查集:find() + union()+ init() 寻找根节点 + 合并子树 + 初始化 #include <stdio.h> #define MAX 100 using namespace std; int father[MAX]; //自己的父亲 int rank[MAX]; //秩 in ...
分类:
其他好文 时间:
2020-01-14 23:37:34
阅读次数:
95
恭贺 treAKer 在毒瘤之神的考验一题中rank1,成为新一届毒瘤之神! ...... 结果今天就考了 treAKer 的毒瘤题... "T1" 考场上看到1e6就想O(n)的做法,结果失败了... 正解思路很神奇,就是先对物品按照a来排序,询问按照m来排序,用双指针一起扫,同时维护$f_i$ ...
分类:
其他好文 时间:
2020-01-12 00:12:11
阅读次数:
125
一些准备工作 为了防止一些分类讨论我们在$s$的末尾加一个 ,假定 是最小的字符。 用$rank_i$表示$\operatorname{suf}_i$的排名,$sa_i$表示排名为$i$的$\operatorname{suf}$的起始位置。 定义一个后缀$\operatorname{suf}_i$为 ...
分类:
其他好文 时间:
2020-01-11 21:57:12
阅读次数:
59
后缀数组 定义 $S$:需要处理的字符串,长度为 $len$ $suf_i$:字符串$S$中下标为 $i \sim len$ 的连续子串(即后缀) $rank_i$:$suf_i$在所有后缀中的排名 $SA_i$:后缀数组,排名为$i$的后缀在原串中的位置,满足 $suf_{SA_1} 0 \end ...
分类:
编程语言 时间:
2020-01-05 22:25:49
阅读次数:
125