zhizhesoft

  • 首页
ZHIZHESOFT
zhizhesoft
codeforces总结

Educational Codeforces Round 84 (Rated for Div. 2) A-E题解

A. Sum of Odd Integers 首先可以算出从1开始到第k个奇数之和。如果和大于n,则不可能存在k个奇数加和等于n,否则用n减去前k个奇数的和,这个差值若是偶数,直接加到最大的奇数上,就可以满足题意要求,否则输出no。 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 int main(){ 5 int t; 6 cin>>t; 7 while(t--){ 8 ll n,k; 9…

2019年7月2日 0条评论 18点热度 0人点赞 risingsun 阅读全文
codeforces总结

Codeforces Round #627 (Div. 3) D-F题解

https://codeforces.com/contest/1324 D. Pair of Topics ai + aj > bi + bj 移项 ai - bi + aj - bj > 0 ,输入a数组和b数组后,做减法构造一个c数组为ai - bi,c数组排序一下,二分找ci - cj 大于0的对数即可。 做这题我很沙雕,离散化之后上了树状数组做,有点麻烦了 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long …

2019年7月2日 0条评论 19点热度 0人点赞 risingsun 阅读全文
页面

Linux性能监控 几个简单的sar命令

简介:sar(System Activity Reporter)是系统活动情况报告的缩写。sar 工具将对系统当前的状态进行取样,然后通过计算数据和比例来表达系统的当前运行状态。它的特点是可以连续对系统取样,获得大量的取样数据;取样数据和分析的结果都可以存入文件,所需的负载很小。 sar 是目前 Linux 上最为全面的系统性能分析工具之一,可以从多方面对系统的活动进行报告,包括:文件的读写情况、系统调用的使用情况、磁盘I/O、CPU效率、内存使用状况、进程活动及IPC有关的活动等。为了提供不同的信息,sar 提供…

2019年7月2日 0条评论 14点热度 0人点赞 risingsun 阅读全文
codeforces总结

Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics) A-D

https://codeforces.com/contest/1323   A. Even Subset Sum Problem. 数据范围只有100,两个for暴力枚举一遍,记录满足题意的区间左右端点即可。最后输出。 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn = 105; 5 ll a[maxn]; 6 int main(){ 7 int t;cin>>…

2019年7月2日 0条评论 20点热度 0人点赞 risingsun 阅读全文
基础算法 - 二分

Codeforces Round #626 Div. 2 D. Present(二分 状态压缩)

https://codeforces.com/contest/1323/problem/D      上个题解.... 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn = 4e5+5; 5 int a[maxn],b[maxn]; 6 int n; 7 int main(){ 8 scanf("%d",&n); 9 int ans = 0; 10 for(int i…

2019年7月2日 0条评论 18点热度 0人点赞 risingsun 阅读全文
页面

CF873F Forbidden Indices [后缀自动机]

没啥意思的后缀自动机系列,但是难度就很高2333 // by Isaunoya #include<bits/stdc++.h> #define int long long using namespace std; struct io { char buf[1 << 25 | 3], *s; int f; io() { f = 0, buf[fread(s = buf, 1, 1 << 25, stdin)] = '\n'; } io& operator >> …

2019年7月2日 0条评论 0点热度 0人点赞 risingsun 阅读全文
页面

P3769 [CH弱省胡策R2]TATT [KD-Tree]

四维显然不能跑,我们直接排序一下,然后三维数点,插入到 kdt,dp 一下即可。 // by Isaunoya #include<bits/stdc++.h> #define int long long using namespace std; struct io { char buf[1 << 27 | 3], *s; int f; io() { f = 0, buf[fread(s = buf, 1, 1 << 27, stdin)] = '\n'; } io& op…

2019年7月2日 0条评论 21点热度 0人点赞 risingsun 阅读全文
页面

P3261 [JLOI2015]城池攻占 [贪心,左偏树]

板子吧,左偏树合并是 1log 的,按照深度合并,而且可以打 tag,pushdown。 // by Isaunoya #include<bits/stdc++.h> #define int long long using namespace std; struct io { char buf[1 << 27 | 3], *s; int f; io() { f = 0, buf[fread(s = buf, 1, 1 << 27, stdin)] = '\n'; } io&…

2019年7月2日 0条评论 15点热度 0人点赞 risingsun 阅读全文
页面

CF500F New Year Shopping [线段树分治,背包]

不会奇怪的背包科技,只能用线段树分治了。 // by Isaunoya #include<bits/stdc++.h> #define int long long using namespace std; struct io { char buf[1 << 25 | 3], *s; int f; io() { f = 0, buf[fread(s = buf, 1, 1 << 25, stdin)] = '\n'; } io& operator >> (int…

2019年7月2日 0条评论 15点热度 0人点赞 risingsun 阅读全文
页面

P5344 【XR-1】逛森林[倍增优化建图,zkw线段树优化spfa]

判下连通,离线下来连边,就是个裸的板子了QvQ。 我们把一堆边连到一个点,那个点连到一堆边,这样就可以满足 [l1,r1] -> to [l2,r2] 了 可以用 zkw 线段树来跑 spfa,奇怪的姿势增加了。 // by Isaunoya #include<bits/stdc++.h> using namespace std; struct io { char buf[1 << 25 | 3], *s; int f; io() { f = 0, buf[fread(s = buf,…

2019年7月2日 0条评论 17点热度 0人点赞 risingsun 阅读全文
1…196261196262196263196264196265
Search

COPYRIGHT © 2022 zhizhesoft. ALL RIGHTS RESERVED.