摘要: 日志级别 不同标准对日志级别有不同的划分。apache log4j对日志级别的定义如下: FATAL A fatal event that will prevent the application from continuing. ERROR An error in the application, 阅读全文
posted @ 2022-08-22 01:18 kurum! 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 思路 线段树维护前缀和。 分别考虑当前数字在中位数左右两种情况。考虑x在中位数右边时把<=x的数变成1,>x的变成-1,要求最大奇异值就是求一段-1、1区间和最大,最大前缀和-最小前缀和即可。按照x的大小对线段树进行区间更新,x在中位数左边时同理。 #include <algorithm> #inc 阅读全文
posted @ 2021-08-18 20:46 kurum! 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 思路 最小费用最大流,把每条边看成一个点,和这条边连通的两点连边,流量为1,费用为0。 超级起点和每条边都建一条边,同样流量为1,费用为0。 每个点和超级汇点建两条边,一条流量为a[i],单位费用为0,一条流量为INF,单位费用为1,跑一遍最小费用。 #include <algorithm> #in 阅读全文
posted @ 2021-07-28 19:25 kurum! 阅读(97) 评论(0) 推荐(0) 编辑
摘要: A. Odd Divisor 判断是否是2的次幂 #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <list> #include <map> #include <iostream> 阅读全文
posted @ 2021-01-26 20:38 kurum! 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 原题 题目描述 给定两个正整数 \(a\) 和 \(b\),求在 \([a,b]\) 中的所有整数中,每个数码(digit)各出现了多少次。 输入格式 仅包含一行两个整数 \(a,b\),含义如上所述。 输出格式 包含一行十个整数,分别表示 $0∼9$在 $[a,b]$中出现了多少次。 输入输出样例 阅读全文
posted @ 2020-12-15 09:26 kurum! 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 原题 One of Pang's research interests is the maximum flow problem. A directed graph \(G\) with nn vertices is universe if the following condition is sat 阅读全文
posted @ 2020-12-10 14:32 kurum! 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 原题 思路 permutation要满足两个条件:1.对于长度为n的排列,最大值为n;2.排列中每个数只出现一次。 可以用树状数组记录每个数出现的次数,再用cnt记录出现超过一次的数的个数,如果从cnt == 0 && sum(n) == n ,则满足permutation条件。 接下来就是处理k每 阅读全文
posted @ 2020-12-10 00:13 kurum! 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 原题 思路 先求出最大生成树,然后对每个询问求LCA,求两点走向LCA路径上的最小权值,树剖实现,求最小值懒得写线段树用了RMQ,虽然r<l的情况没特判调了很久。还是比较简单的模板题,但是找了很久bug。 #include <algorithm> #include <cmath> #include 阅读全文
posted @ 2020-12-06 02:10 kurum! 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 原题 Roman planted a tree consisting of n vertices. Each vertex contains a lowercase English letter. Vertex 1 is the root of the tree, each of the n - 1 阅读全文
posted @ 2020-11-30 22:22 kurum! 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 原题 Given a sequence of n numbers a1, a2, ..., an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you h 阅读全文
posted @ 2020-11-12 22:20 kurum! 阅读(184) 评论(0) 推荐(0) 编辑