链接 显然是用map映射一下,然后用线段树查询区间最值,如果给出的两年中有一年未知,二分找到它附近的位置(如果是x未知找第一个大于x的位置,如果是y未知找最大的小于y的位置) 然后再加亿点点细节: 我们就可以用这几个量来判断。 rain[i]:i位置的降雨量 year[i]:i位置的年份 x,y:题 ...
分类:
其他好文 时间:
2020-11-04 18:39:08
阅读次数:
16
1. 判断状态: if RzCheckTree1.Selected.StateIndex = 2 then //则为选中状态 else if RzCheckTree1.Selected.StateIndex = 1 then //则为未选中状态 else if RzCheckTree1.Select ...
分类:
其他好文 时间:
2020-11-04 17:45:55
阅读次数:
17
比赛链接:https://codeforces.com/contest/1436 ##A.Reorder ##题解 经过模拟计算,观察到 \(\sum_{i=1}^n \sum_{j=i}^n \frac{a_j}{j}=\sum_{i=1}^n a_i\) 判断每个n个数的和sum与m是否相等即可 ...
分类:
其他好文 时间:
2020-11-02 10:35:02
阅读次数:
17
b题:b其实不难题意就是不让k个连续字符成为一个周期。这提给我的教训就是中文翻译应该结合英文题目一起看, #include<bits/stdc++.h>#include<algorithm>#define ll long longusing namespace std;const ll nl=1e5 ...
分类:
其他好文 时间:
2020-11-02 10:12:11
阅读次数:
22
实验结果: ex1: 1 #include <stdio.h> 2 int main() { 3 int a=5, b=7, c=100, d, e, f; 4 5 d = a/b*c; 6 e = a*c/b; 7 f = c/b*a; 8 9 printf("d=%d, e=%d, f=%d\n ...
分类:
其他好文 时间:
2020-11-01 22:18:22
阅读次数:
14
区间符合条件的充要条件是$Max-Min+1=Cnt$其中$Max,Min,Cnt$分别为区间最大值,最小值,不同的数的个数。 变形后得$Max-Min-Cnt+1=0$ 考虑枚举右端点,在线段树上维护左端点$Max-Min-Cnt+1$的最小值。 $Min,Max$可以用单调栈维护,记$last_ ...
分类:
其他好文 时间:
2020-11-01 22:11:08
阅读次数:
14
任务1 //ex1.cpp #include<stdio.h> int main(){ int a=5, b=7, c=100, d, e, f; d=a/b*c; e=a*c/b; f=c/b*a; printf("d=%d, e=%d, f=%d",d,e,f); return 0; } d=5 ...
分类:
其他好文 时间:
2020-11-01 22:08:49
阅读次数:
15
已知函数y=x+3(x>0);y=0(x=0);y=x^2-1(x<0); 请设计一个方法实现上面的函数,根据传入的值x的不同,返回对应y值。 提示: 1.定义一个static修饰符修饰的方法,方法接受一个int类型的参数x,返回值为int类型。 2.在方法中使用if...else if...els ...
分类:
编程语言 时间:
2020-11-01 21:29:23
阅读次数:
25
一、手动分页 django从ciew向template传递HTML字符串的时候,django默认不渲染此HTML,为了防止这串字符串里有恶意攻击的代码,所以要使用mark_safe函数 from django.utils.safestring import mark_safe def view(re ...
分类:
其他好文 时间:
2020-11-01 21:26:57
阅读次数:
23
我发现有些人习惯在 /etc/profile 文件里面配置环境变量,在这里配置挺不好的。 # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (ba ...
分类:
系统相关 时间:
2020-11-01 10:17:26
阅读次数:
24