E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
LLA
CCPC-Wannafly Winter Camp Day1 (Div2, onsite) C 拆拆拆数 数论
以内暴力就可以得到答案为什么是这样我也不清楚哈哈当作一个结论记了AC代码#include#includeusingnamespacestd;typedeflonglongll;constintINF=0x3f3f3f3f;llgcd(
lla
CaprYang
·
2020-09-12 08:22
_数学数论_
2019
CCPC-Wannafly
Winter
Camp
牛客小白月赛14(部分题解)
#include#includeusingnamespacestd;#definelllonglongconstllmod=998244353;lln,k,p;llpow_m(
lla
,llk,llp){
Thinking knife
·
2020-09-12 08:55
算法提高 翔集合
算法提高翔集合//矩阵快速幂实现翔集合#include#include#includeusingnamespacestd;typedeflonglongll;structnode{
llA
[5][5];node
^阳光温热^
·
2020-09-12 08:49
POJ2456(二分/最大化最小值)
DescriptionFarmerJohnhasbuiltanewlongbarn,withN(2#include#include#include#definelllonglongusingnamespacestd;intn,c;//intarr;
lla
抛书人对一枝秋
·
2020-09-12 07:27
贪心
poj
[Codeforces 1244C] The Football Season(扩展欧几里得)
w比较大,所以这样x+y比较小,不容易让z#include#include#includeusingnamespacestd;typedeflonglongLL;voidexgcd(
LLa
,LLb,LL
QASWINE
·
2020-09-12 06:27
OI/ACM
Solution
【BZOJ 4031】[HEOI2015]小Z的房间 基尔霍夫矩阵
include#include#include#defineLLlonglong#defineMod1000000000usingnamespacestd;intn,m,cnt,mat[85][85];
LLa
pbihao
·
2020-09-12 06:58
基尔霍夫矩阵
生成树计数
ac之路
bzoj
HDU6442(二项式)
形为\({(a+b\sqrt{B})}^n\)的快速幂#include#include#includeusingnamespacestd;typedeflonglongll;intT;
llA
,B,n,p
dengliaotu5386
·
2020-09-12 05:27
2020 Multi-University Training Contest 4
includeusingnamespacestd;typedeflonglongll;constlonglongINF=0x3f3f3f3f3f3f3f3f;constintN=5e3+10;structwapon{
lla
Zaller
·
2020-09-12 05:48
多校
Gym - 101128C:Canvas Painting
include3#include4#include5#include6usingnamespacestd;7typedeflonglongLL;8intT;9constintmaxn=100000+10;10
LLa
weixin_30257433
·
2020-09-12 05:49
51nod:1118 机器人走方格(排列组合+逆元)
(2 #defineLLlonglongconstLLM=1000000007;LLquick_pow(
LLa
,LLb){L
zugofn
·
2020-09-12 01:57
逆元
exgcd
排列组合
codeforces 830A
=getchar();while(ch'9')ch=getchar();for(;ch>='0'&&ch<='9';ch=getchar())ret=ret*10+ch-'0';returnret;}
lla
ThreeWater-
·
2020-09-11 16:10
二分答案
CF830A Office Keys
#include#include#include#defineLLlonglongusingnamespacestd;
LLa
[2
Zhousom
·
2020-09-11 16:23
codefoces
Codeforces 1353 C. Board Moves
AC代码:constintN=5e5+50;intn,m,k;
lla
[N];intmain(){intt;sd(t);a[1]=0;for(lli=3,j=1;i<=N-10;i+=2,j++)a
邵光亮
·
2020-09-11 16:00
CodeForces
Codeforces 831D Office Keys 贪心or dp
LLa
[maxn],b[maxn];voidsolve(){sort(a+1,a+n+1);sort(b+1,b+k+1);LLans=2*inf;for(inti=1;i<=k-n+1;++i){LLsum
sega_handsome
·
2020-09-11 15:24
简单基础经典dp
思维
Codeforces 831D Office Keys 贪心枚举
暴力2e6复杂度先排序左边人尽量拿左边钥匙右边人尽量拿右边的用n个人长度滑窗钥匙长度为k的区间所有方案枚举比如2人4把钥匙1-22-33-43种方案O(kn)=20001000=2e6
lla
[maxn]
阿晴0219
·
2020-09-11 12:45
二分
动态规划dp
暴力枚举
蓝桥杯(进制转化)
输入格式输入的第一行为一个正整数n(1#include#include#include#definelllonglongusingnamespacestd;
lla
[1000000];intmain(){
zifengningyu
·
2020-09-11 06:40
进制转化
详细讲解【快速幂】
代码:#includetypedeflonglongintll;llqpow(
lla
,llb,llq)//代码是传了三个变量最后q为mod{llans;ans=1;//ans表示要输出的结果while(
XJHui's Blog
·
2020-09-11 05:29
ACM-ICPC
LA4119 -- Always an integer
include#include#include#includeusingnamespacestd;typedeflonglongLL;constintN=500001;charstr[N];intn,d;
LLa
钱晓峰
·
2020-09-11 02:21
语言教学
解题报告
UVALive
模拟
####字符串####
c语言
LA题解
数论
字符串输入
【补题】Codeforces #507(Div1) AB
llA
[M],B[M],t;intX[M],n;intsolve(){for(inti=1;i=RANGE){lll,r,m=(su
Little_Fall
·
2020-09-11 02:09
题解
luogu P4085 [USACO17DEC]Haybale Feast(尺取法 + 线段树)
include#include#includeusingnamespacestd;typedeflonglongll;constintN=500007,INF=0x3f3f3f3f;intn;llm;
lla
繁凡さん
·
2020-08-26 15:14
#
尺取法
#
线段树
P4447 [AHOI2018初中组]分组
果不其然只拿了60#include#include#include#includetypedeflonglongintll;usingnamespacestd;intmain(){lln;cin>>n;
lla
van之风
·
2020-08-26 15:14
贪心
Feel Good(单调栈)(一点也不good!)
details/78136480;我的代码:#include#include#include#includeusingnamespacestd;typedeflonglongLL;intmain(){
LLa
qdu_ellery
·
2020-08-26 15:00
stl
单调栈及单调队列
uva10160(dfs+状态压缩)
ServicingstationsAcompanyofferspersonalcomputersforsaleinNtowns(3#include#includeusingnamespacestd;#definelllonglongintn,m;
lla
少点多些
·
2020-08-26 14:53
DFS
快速幂,快速乘
快速幂问题求a的b次方对p取模的值,其中0usingnamespacestd;typedeflonglongll;
lla
,b,p;intfun(){llans=1%p;while(b){if(b&1){
過去※
·
2020-08-26 14:38
#
算法模板
求解逆元的两种方法
intexgcd(
lla
,llb,ll&x,ll&y){if(b==0){x=1;y=0;returna;}llgcd=exgcd(b,a%b,x,y);lltmp=x;x=y;y=tmp-(a/b)*
Cross.
·
2020-08-26 14:00
2018中国大学生程序设计竞赛 - 网络选拔赛---Find Integer!--hdu6441
介绍一个名词:奇偶数列法则Keypart:#include#include#include#includeusingnamespacestd;#definelllonglongintmain(){intt;
lla
banteng7670
·
2020-08-26 12:08
CodeFroces-- Feel Good
includeusingnamespacestd;#definemaxn100015#defineLLlonglongLLll[maxn],rr[maxn];stacks,t;LLsum[maxn];
LLa
dianzanji4884
·
2020-08-25 17:03
Quadratic equation
mod=(b\timesb-4\timesc)\%mod$#includeusingnamespacestd;typedeflonglongll;constllmod=1000000007;llqp(
lla
asmallfish1985
·
2020-08-25 16:36
概率专题 扫雷:回到原点的概率
tweetuzki/p/10777822.html代码:#include#definelllonglongusingnamespacestd;constllMOD=1e9+7;llquick_pow(
lla
H_ang
·
2020-08-25 09:15
概率
【初等数论】如何用程序求解单变元模线性方程?
“拓展欧几里得”的知识,这里只介绍概念,不加求证拓展欧几里得已知a,b求ax+by=gcd(a,b)以下函数求解出x和y,并返回gcd(a,b)的值typedeflonglongll;llexgcd(
lla
三号室
·
2020-08-25 06:05
ACM
数论
算法
【HNOI2008】越狱
正难则反,在全部的可能中减去不可能发生越狱的情况#include#definellunsignedlonglong#definemo100003usingnamespacestd;llqsm(
lla
,llb
zhuzy2020
·
2020-08-25 06:20
组合计数
容斥原理
Codeforces Round 89 (Rated for Div. 2)
intmain(){intt;cin>>t;while(t--){
lla
,b;cin>>a>>b;if(2*min(a,b)>t;while(t--){lln,
张小生的先生
·
2020-08-25 05:15
Codeforces Round #280 (Div. 2)A B C
A-VanyaandCubes:#include#include#includeusingnamespacestd;typedef__int64ll;constintN=10005;
lla
[N];intmain
zxxxxzzz
·
2020-08-25 04:48
CF
B. Odd Sum Segments(基础数论 奇数个奇数相加==奇数,奇数个奇数+偶数==奇数,奇数+奇数==偶数)
所以可以知道条件了;AC代码:#includeusingnamespacestd;typedeflonglongll;intmain(){
lla
[200010],Q,n,cnt,k;scanf
Forward in time
·
2020-08-25 04:56
数论
【前缀和】B014_LQ_k倍区间(烂公式转换)
typedeflonglongll;intmain(){std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);lln,k,ans=0;cin>>n>>k;
llA
wdt_
·
2020-08-25 04:42
#
前缀和与差分
Codeforces Round #624 (Div. 3)(D暴力,E思维+复杂模拟,F线段树)
hack#include#definerep(i,a,b)for(inti=a;i#definemkmake_pairusingnamespacestd;typedeflonglongll;llgcd(
lla
ccsu_deer
·
2020-08-25 04:04
codeforce题解
数据结构---线段树
O( nlogn )预处理, O( 1 ) 求组合数模板
typedeflonglongLL;constintmaxn=5e5;constlonglongmod=1e9+7;
LLA
[maxn];LLB[maxn];voidInit(){A[0]=1;for(inti
你也想起舞?
·
2020-08-25 04:33
常用知识
组合数模板O(nlogn)预处理, O(1)出答案
typedeflonglongLL;constintN=5e5+10;constLLmod=1e9+7;
LLA
[N],B[N];voidInit(){A[0]=1;for(inti=1;i
FTIP
·
2020-08-25 04:45
分块
分块structBlock{staticconstint__=50005;staticconstint_b_=300;
lla
[__];intn,bsz,bel[__];llad[_b_];vectorord
fo0Old
·
2020-08-25 03:05
CodeForces 16C Monitor (简单题)
题目类型简单题题目意思给出一块x*y的显示屏(1#include#include#include#include#includeusingnamespacestd;typedeflonglongLL;LLgcd(
LLa
yunyouxi0
·
2020-08-25 02:09
简单题
杨辉三角前n行偶数的个数
#include#include#include#include#include#includeusingnamespacestd;typedeflonglongll;
lla
[201],p[201];llf
桂十三
·
2020-08-25 02:08
题目
Codeforces Round #641 (Div. 1) A. Orac and LCM(数论 gcd与lcm性质)
definesci(a)scanf("%d",&(a))typedeflonglongll;constintN=1e5+10;lllcm(llx,lly){returnx/__gcd(x,y)*y;}intn;
lla
Code92007
·
2020-08-25 02:50
数论
简单的欧几里德与扩展欧几里德
voidex_gcd(
LLa
,LLb,LL&x,LL&y){if(!
ALXPCUN
·
2020-08-25 02:00
2018牛客暑假多校四 A(打表+数论)
问多少次操作后,变成空串n#definemaxn100010usingnamespacestd;typedeflonglongll;llpowmod(
lla
,lln,llmo){//快速幂llres=1
weixin_30247781
·
2020-08-25 02:38
【一败涂地】L1-006 连续因子 (20分) 题解
输入输入在一行中给出一个正整数N(1//记得如果用i*i>t;
lla
=2,b=2,l=0;for(lli=
H_On
·
2020-08-25 01:29
题解
题解 P1417 【烹调方案】
#includeusingnamespacestd;constintinf=0x7fffffff;#definelllonglongllt,n,dp[100010],ans=0;structNode{
lla
live_now
·
2020-08-25 01:42
洛谷题解
动态规划专题讲解
算法
动态规划
动态规划求解
HDU2683:完全数+组合数
代码:#includeusingnamespacestd;typedeflonglongll;chart;llx,y;vectorv;llpower(
lla
,lln){llans=1;while(n){
月光下的魔术师
·
2020-08-24 23:19
数论
G - Problem G. Cyclic(打表+特殊数列)
问把它排成满足任何一个数的后一个不能比它的前一个大一的方案总数;这道题我是OEIS的,QAQ;直接通式:#includeusingnamespacestd;typedeflonglongll;#defineMod998244353
lla
Forward in time
·
2020-08-24 23:12
数论
逆序数《求所有子序列的逆序对个数的和
O(nlogn)代码#include#include#include#includeusingnamespacestd;#defineLLlonglongint#definemod1000000007
LLa
zz你的名字
·
2020-08-24 18:54
ACM-逆序数
线段树--双标签
#include#include#include#include#definemaxn100010typedeflonglongLL;usingnamespacestd;
LLa
[maxn],n,p;structnode
ling_fly
·
2020-08-24 15:42
模板
线段树
上一页
3
4
5
6
7
8
9
10
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他