摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn = 1e6 + 10; 4 struct node{ 5 int l, r, addv, setv, maxv, minv, sum; 6 }e[maxn * 4]; 阅读全文
posted @ 2020-03-06 19:10 jvruodejxt 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 题目链接 用bitset计算出所有的子集情况。 从右向左数的第几位就代表是几; 1 #include<cstring> 2 #include<cstdlib> 3 #include<algorithm> 4 #include<cmath> 5 #include<bitset> 6 using nam 阅读全文
posted @ 2020-02-29 20:10 jvruodejxt 阅读(71) 评论(0) 推荐(0) 编辑
摘要: int exgcd(int a,int b,int &x,int &y)//扩展欧几里得算法 { if(b==0) { x=1;y=0; return a; //到达递归边界开始向上一层返回 } int r=exgcd(b,a%b,x,y); int temp=y; //把x y变成上一层的 y=x 阅读全文
posted @ 2020-02-21 20:32 jvruodejxt 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 一场cf的题,题目链接; 题目大意是给你一串数字,你可以选择任意区间,让其中的每一个数的值是整个区间和的平均数,求最小的字典序。 这个题需要让前面的序列越小越好即寻找 r 令sum(1-r)/r最小,然后让1取代r继续类推,,暴力的写法T了; 一开始暴力的写了一发,T了 1 #include<bit 阅读全文
posted @ 2020-02-10 20:04 jvruodejxt 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 1 #include <algorithm> 2 #include <cmath> 3 #include <cstdio> 4 #include <cstring> 5 #include <deque> 6 #include <iostream> 7 #include <map> 8 #includ 阅读全文
posted @ 2020-02-09 11:39 jvruodejxt 阅读(163) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<iostream> #include<string.h> #include<bits/stdc++.h> using namespace std; long long s[1020],k; void prime(long long m)//求一个 阅读全文
posted @ 2020-01-31 19:13 jvruodejxt 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 转载:https://blog.csdn.net/liuzibujian/article/details/81086324 欧拉函数φ(n)是1~n-1的与n互质的数的个数 通式:φ(x) = x * (1 - 1/p1) * (1 - 1/p2) * ......; (pi 为x所有质因子);欧拉 阅读全文
posted @ 2020-01-31 16:25 jvruodejxt 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 蒟蒻的jxt人生第一场cf,虽然无比垃圾,场上只A了A(25min),B题(50min)(着实太慢,1A),C题想了半个小时左右一开始以为是排列组合,后来觉得应该是DP但是还是没有头绪第二天写了半天,竟然奇怪的A了,不过代码着实垃圾。DP用循环来写还是不太熟练,用的递归。。。侥幸没T。 C. TWO 阅读全文
posted @ 2020-01-16 19:17 jvruodejxt 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 这道题看起来非常复杂,,,看了看大佬们的代码感觉太优秀了。。。。。用最简单的方法考虑所有未知。。。。。。。不浪费一行代码/。。。 1 #include <stdio.h> 2 3 #include <stdlib.h> 4 5 #include <string.h> 6 7 char a[15][1 阅读全文
posted @ 2019-03-01 16:11 jvruodejxt 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<string> 3 #include<iostream> 4 #include<cstring> 5 using namespace std; 6 7 int bian[100][100], vis[100]; 8 void cont (c 阅读全文
posted @ 2019-02-25 19:09 jvruodejxt 阅读(116) 评论(0) 推荐(0) 编辑

Contact with me