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…
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…
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 …
简介:sar(System Activity Reporter)是系统活动情况报告的缩写。sar 工具将对系统当前的状态进行取样,然后通过计算数据和比例来表达系统的当前运行状态。它的特点是可以连续对系统取样,获得大量的取样数据;取样数据和分析的结果都可以存入文件,所需的负载很小。 sar 是目前 Linux 上最为全面的系统性能分析工具之一,可以从多方面对系统的活动进行报告,包括:文件的读写情况、系统调用的使用情况、磁盘I/O、CPU效率、内存使用状况、进程活动及IPC有关的活动等。为了提供不同的信息,sar 提供…
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>>…
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…
没啥意思的后缀自动机系列,但是难度就很高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 >> …
四维显然不能跑,我们直接排序一下,然后三维数点,插入到 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…
板子吧,左偏树合并是 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&…
不会奇怪的背包科技,只能用线段树分治了。 // 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…
判下连通,离线下来连边,就是个裸的板子了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,…
COPYRIGHT © 2022 zhizhesoft. ALL RIGHTS RESERVED.