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
codeforce
【解题报告】 Educational
Codeforce
s Round 19
题目链接A.k-Factorization(
Codeforce
s797A)思路本题入手的角度是将输入的n看成一系列素数(素因子)的乘积。
TRiddle
·
2020-09-12 12:29
Codeforces
codeforce
s xxx d
因为要早睡所以赛后做这个题挺有意思nlgn的算法boolv[2111111];intpre[2111111];inta[222222];intn;intmain(){scanf("%d",&n);for(inti=0;i
ACpac
·
2020-09-12 12:40
codeforce
s 俄罗斯季度决赛题目sequence解答
原题大意如下:用两种操作产生数字序列:加倍和数字排序。数字排序就是升序方式排列数字,如数值6532,排列后的结果是2356。序列都是从1开始,序列前15个数值时124816234629581162234462895781156。请编程算出第n个序列中的数值是什么。1intmain(){inti,j,k,n,c,tmp,flag,bits,count,nn;intnum[20]={0,1,0};in
liyinchen808
·
2020-09-12 12:05
算法
解题报告
codeforce
s 242B
原题目链接如下:http://
codeforce
s.com/problemset/problem/242/B解这小道题目让我大费周折。主要原因是轻视了。人一轻敌,思维就不缜密。
liyinchen808
·
2020-09-12 12:04
算法
codeforce
s上解题感受
这两天找个到了个程序比赛的网站:www.
codeforce
s.com该网站最大的好处是,可以看大家的源代码,这对个人的进步很重要。
liyinchen808
·
2020-09-12 12:04
感悟
解题报告
codeforce
s 242A
原题链接如下:http://www.
codeforce
s.com/problemset/problem/242/A这题比较简单,但是这题给我个启示:不要时时苛求算法,有时性能稍逊一点,方法则简单很多,更容易理解
liyinchen808
·
2020-09-12 12:04
算法
Codeforce
s 1114C
Codeforce
s1114C题目1114C题意求bbb进制下的n!n!n!末尾有多少000分析首先要知道对于十进制下n!n!n!
strategist_614
·
2020-09-12 11:02
【
Codeforce
s 1114 F. Please, another Queries on Array?】 线段树维护区间乘积 区间欧拉函数
Codeforce
s1114F题意维护区间乘求区间乘积的欧拉函数ϕ(n) = nΠprime∣nprime− 1prime那么对于我们区间乘来说因为小于300内的质数很少所以我们可以用long
ljq--linuxer
·
2020-09-12 10:55
ACM
DS-线段树
CodeForce
s 185A. Plant(矩阵快速幂)
题目链接:http://
codeforce
s.com/problemset/problem/185/ADwarfshaveplantedaveryinterestingplant,whichisatriangledirected"upwards
田益铭
·
2020-09-12 09:18
快速幂
Codeforce
s839D Winter is here (数论:容斥原理)
D.Winterisheretimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWinterishereattheNorthandtheWhiteWalkersareclose.JohnSnowhasanarmyconsistingofnsoldiers.Whilet
会打架的程序员不是好客服
·
2020-09-12 09:34
CodeForces
Codeforce
s-839D Winter is here(容斥原理)
D.Winterisheretimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWinterishereattheNorthandtheWhiteWalkersareclose.JohnSnowhasanarmyconsistingofnsoldiers.Whilet
丿残念灬
·
2020-09-12 09:20
初等数论
Codeforce
s 839 D. Winter is here (莫比乌斯反演)
DescriptionWinterishereattheNorthandtheWhiteWalkersareclose.JohnSnowhasanarmyconsistingofnsoldiers.WhiletherestoftheworldisfightingfortheIronThrone,heisgoingtogetreadyfortheattackoftheWhiteWalkers.Heh
小坏蛋_千千
·
2020-09-12 09:16
组合数学
Codeforce
s 839D Winter is here【容斥原理+数学公式】
D.Winterisheretimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWinterishereattheNorthandtheWhiteWalkersareclose.JohnSnowhasanarmyconsistingofnsoldiers.Whilet
mengxiang000000
·
2020-09-12 09:58
数论&&组合数学
思维
Codeforce
s 839 D. Winter is here 容斥
传送门:
Codeforce
s839D题意:给出一个序列,求取出一个字序列,当他们的GCD大于1时,将贡献子序列所有数的gcd*子序列的长度,问总贡献是多少。
WA是一笔财富
·
2020-09-12 09:48
codeforces
数学
CodeForce
s 839D Winter is here (容斥原理)
题目链接:http://
codeforce
s.com/problemset/problem/839/D题意:有n个士兵,每个士兵的力量值为a[i],现在按照输入的顺序选择k个数(即选择i,i+1,i+3
TooSIMple_
·
2020-09-12 09:23
CodeForces
数学
Codeforce
s 839D-Winter is here
Winterisheretimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWinterishereattheNorthandtheWhiteWalkersareclose.JohnSnowhasanarmyconsistingofnsoldiers.Whilethe
Wang_128
·
2020-09-12 08:36
Codeforces
----组合数学
----容斥
CodeForce
s 839D Winter is here(数学 容斥)
题意:给你n个数,问你所有满足gcd>1的子集,每个子集贡献为子集内元素个数*子集gcd,问所有满足条件的集合的贡献和。思路:可以枚举gcd,计算每个gcd的贡献,设含因子i的个数为cnt[i],gcd为i的贡献个数为1*C(cnt[i],1)+2*C(cnt[i],2)+3*C(cnt[i],3)...+cnt[i]*C(cnt[i],cnt[i]))-i*2的贡献-i*3的贡献....,可以记
cillyb
·
2020-09-12 08:59
组合数学
codeforce
s 839d Winter is here
一场给dalao们吐槽到不行。全场B题最后终测挂了9/10的div2。hack频频出错。B题比D题还难的场。。多校中插一脚cf。hhhhhhh题目传送门题意:给一个序列,要求找一个可以不连续长度为k的子序列满足下标i11可以贡献p*k的价值。现在问对于这个序列的所有情况的贡献是多少。思路:其实可以不要被这个下标蒙蔽了。下标没什么的。只是限定你只能使用一次这个序列而已。比赛的时候发现其实对于每一个位
QuanQqqqq
·
2020-09-12 08:26
容斥
Educational
Codeforce
s Round 80 (Rated for Div. 2) D. Minimax Problem
D.MinimaxProblem考虑二分答案,对于二分出的某个值x,先将原数组处理成二进制的形式,大于x的位为1,这样二进制数上限为2^8-1=255,然后暴力check。#include#definelllonglong#definePBpush_back#defineendl'\n'#defineINF0x3f3f3f3f#defineLINF0x3f3f3f3f3f3f3f3f#define
Thinking knife
·
2020-09-12 08:54
比赛题解
Codeforce
s 986A. Fair(对物品bfs暴力求解)
解题思路:1.对物品ibfs,更新每个小镇j获得每个物品i的最短距离。2.时间复杂度o(n*k*logk),满足2s的要求。代码:#include#include#include#include#include#includeusingnamespacestd;typedeflonglongll;#defineMAX2000000000inta[500050];liste[500050];intd
zhangjiuding
·
2020-09-12 08:32
【题解】[
codeforce
s round #198 div2]Tourists problem
题目大意:有n个点分布在一条直线上,每个点有一个正数坐标(没有两个点坐标相同)。。现在从0位置出发,以任意顺序遍历这n个点(不回到0)。。。求出平均路线长度,用最简分数表示。把整个路径拆成一段一段的来分析。。包含直接从0到i的路径有(n-1)!条(可以把i排到第一个位置,其他n-1个点做全排列)然后包含直接从j到i的路径可以这么分析:先设i的位置比j小(因为题目本身没有这个限制,所以统计完了之后还
_zslzx_
·
2020-09-12 08:54
题解
决定了,把以前做过的CF,TC总结都补上来
Codeforce
s:
Codeforce
sRound#154(div2):http://
codeforce
s.com/contest/253
Codeforce
sRound#170(div2):http:
yew1eb
·
2020-09-12 08:08
ACM-套题总结
Codeforce
s-984B - Minesweeper - 暴力
题解链接:https://www.lucien.ink/archives/210/题目链接:http://
codeforce
s.com/contest/984/problem/B题目:OnedayAlexdecidedtorememberchildhoodwhencomputerswerenottoopowerfulandlotsofpeopleplayedonlydefaultgames.Ale
LucienShui
·
2020-09-12 08:18
题解
搜索
codeforce
s 336c
一开始想错了。想到要被2^k整除,那么找到最大的lowbit(x)即可。但是也有可能实际答案比lowbit还要大。所以应该直接枚举k,然后看是否有和2^k-1一系列与之后为0的,如果有的话说明k满足,k从大到小枚举即可。AC代码:#include#includeconstintMAX_NUMBER=100006;intvalue[MAX_NUMBER];intans[MAX_NUMBER];int
xcszbdnl
·
2020-09-12 08:02
ACM_数论
codeforce
s B. Dreamoon Likes Permutations
题目题意:你有一个序列aaa,现在你可以把aaa分成两部分,但是要保证两个部分都有111~xxx中的每个整数都存在,且len=x−1+1len=x-1+1len=x−1+1也就是说每一部分数字唯一。思路:我们可以设置两个数组ql,qrql,qrql,qr,从头开始扫如果这个点满足上述条件,那么就将qlqlql置成truetruetrue,然后qrqrqr从后往前扫,最后从前往后遍历一遍,如果出现了
忘梦心
·
2020-09-12 08:15
codeforces
codeforce
s 题解
Codeforce
sRound#666(Div.2)题解查看题解Educational
Codeforce
sRound94(RatedforDiv.2)查看题解
Codeforce
sRound#665(Div
忘梦心
·
2020-09-12 08:15
codeforces
Codeforce
s Global Round 10 题解
A.OmkarandPassword查看题解数学B.OmkarandInfinityClock查看题解数学C.OmkarandWaterslide查看题解贪心D.OmkarandBedWars查看题解贪心E.OmkarandDuck查看题解构造
忘梦心
·
2020-09-12 08:15
codeforces
Codeforce
s Round #228 (Div. 1) B. Fox and Minimal path (构造&最短路)
B.FoxandMinimalpathtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputFoxCielwantstowriteataskforaprogrammingcontest.Thetaskis:"Youaregivenasimpleundirectedgrap
东野圭吾#
·
2020-09-12 08:28
图论
Codeforces
构造
Codeforce
s Beta Round #77 (Div. 1 Only) C. Volleyball (二维最短路&贪心)
C.Volleyballtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPetyalovesvolleyballverymuch.Onedayhewasrunninglateforavolleyballmatch.Petyahasn'tboughthisownca
东野圭吾#
·
2020-09-12 08:57
Codeforces
最短路
[
CodeForce
s - 208E] Blood Cousins(k代兄弟问题)
题目链接加强版例题(还没写)题意:给定一棵nnn个结点的树。给出mmm次询问,每次询问给出xxx和kkk,问xxx有多少个kkk代兄弟。(两个点互为kkk代兄弟的定义是他们的kkk级祖先相同)1≤n,m≤1051\leqn,m\leq10^{5}1≤n,m≤105做法:把所有点以深度为第一关键字,dfsdfsdfs序为第二关键字排序。然后kkk代兄弟一定是在一段连续的区间中的,这样就转化成区间问题
Zimba_
·
2020-09-12 08:23
树学
CodeForce
s 986C AND Graph (逻辑运算+思维+DFS)
题目链接题意:第一行给出一个n和m,随后一行是m个数据,数据范围是0~(1#include#include#include#include#include#include#include#includeusingnamespacestd;#definelllonglong#defineinf0x3f3f3f3fconstintmaxn=1<<23;boola[maxn];//用于记录哪个是给出的数
Fushicho_XF
·
2020-09-12 07:26
逻辑运算
思维
搜索
Codeforce
s 986B - Petr and Permutations
给定一个长度为n序列的排列,问改序列是由原序列进行3n还是7n+1次交换得到的由7n+1-3n=4n+1知道两个数奇偶性不同那么我们计算序列的奇偶性即可得补一种O(n)的做法1#include2#include3#include4usingnamespacestd;567intN;8constintmaxn=1e6+10;9intA[maxn];1011intmain(){12scanf("%d"
weixin_34013044
·
2020-09-12 07:13
Codeforce
s Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) D. Little Artem and Dance 模拟
D.LittleArtemandDance题目连接:http://www.
codeforce
s.com/contest/669/problem/DDescriptionLittleArtemisfondofdancing.MostofalldancesArtemlikesrueda—Cubandancethatisdancedbypairsofboysandgirlsformingacirclea
weixin_33830216
·
2020-09-12 07:03
2018-2019 ACM-ICPC Southeastern European Regional Programming Contest (SEERC 2018)
2019ACM-ICPCSoutheasternEuropeanRegionalProgrammingContest(SEERC2018)author:"luowentaoaa"catalog:truetags:mathjax:true-
codeforce
sB.BrokenWatch
weixin_30858241
·
2020-09-12 07:50
Codeforce
s Round #233 (Div. 2)D. Painting The Wall 概率DP
D.PaintingTheWallUseraintadecidedtopaintawall.Thewallconsistsofn2tiles,thatarearrangedinann × ntable.Sometilesarepainted,andtheothersarenot.Ashewantstopaintitbeautifully,hewillfollowtherulesbelow.Firs
weixin_30794499
·
2020-09-12 07:48
CodeForce
s - 987E Petr and Permutations (思维+逆序对)
题意:初始有一个序列[1,2,...N],一次操作可以将任意两个位置的值互换,Petr做3*n次操作;Alxe做7*n+1次操作。给出最后生成的新序列,问是由谁操作得到的。分析:一个序列的状态可以归为:由原序列操作奇数次得到(简称奇序列);和操作偶数次(偶序列)得到。显然奇序列中,逆序对的个数为奇数;偶序列中,逆序对的个数为偶。当n为奇数时,3*n为奇,7*n+1为偶;n为偶数时正好相反。用树状数
weixin_30675967
·
2020-09-12 07:13
Atcoder&
CodeForce
s杂题11.6
PrefaceNOIP前突然不知道做什么,感觉思维有点江僵化,就在vjudge上随便组了6道ABCD+CFDiv2C/D做,发现比赛质量还不错,知识点涉及广,难度有梯度,码量稍小,思维较多.同时发现vjudge的比赛功能很不错A.ABC112-D-Partition难度感觉比NOIPT1简单了些了首先naiive的想法是枚举这个公约数\(D\),但是发现有\(D*N=1;i--){if(m%i==
weixin_30652491
·
2020-09-12 07:11
Codeforce
s 986B. Petr and Permutations(没想到这道2250分的题这么简单,早知道就先做了)...
这题真的只能靠直觉了,我没法给出详细证明。解题思路:1.交换3n次或者7n+1次,一定会出现一个为奇数,另一个为偶数。2.用最朴素的方法,将n个数字归位,计算交换次数。3.判断交换次数是否与3n的奇偶性相同,相同输出Petr;不相同则一定与7n+1的奇偶性相同,输出Um_nik。代码:#includeusingnamespacestd;typedeflonglongll;inta[1000010]
weixin_30614587
·
2020-09-12 07:39
codeforce
s 669D D. Little Artem and Dance(乱搞题)
题目链接:D.LittleArtemandDancetimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputLittleArtemisfondofdancing.MostofalldancesArtemlikesrueda—Cubandancethatisdancedby
weixin_30466953
·
2020-09-12 07:01
CF补题
CodeForce
过题数/总题数ABCDEFGHEducational
Codeforce
sRound64(RatedforDiv.2)1/7ACWA**
Codeforce
sRound#556(Div.2
weixin_30262255
·
2020-09-12 07:21
CodeForce
s 669D(小思维+负数取模)
题目链接:http://
codeforce
s.com/problemset/problem/669/D题意:q次按顺序操作,操作1:整体移动给定单位距离;操作2:奇偶位互换,要求输出q次操作后的情况思路
weixin_30247307
·
2020-09-12 07:20
CodeForce
s 398B Painting The Wall 概率DP
题目大意:就是现在有一个n*n的墙,初始的时候有m个位置被涂过,现在每次从中随机选一个位置,如果没有涂过就涂上,如果涂过就什么也不做,问需要经过多少次选择使得每行每列都有被涂过的格子大致思路:简直和2014年牡丹江现场赛的D题惊人相似...转移方程细节见代码代码如下:Result:AcceptedMemory:31356KBTime:124ms/**Author:Gatevin*CreatedTi
Gatevin
·
2020-09-12 07:45
ACM_Probability
Codeforces
CodeForces
398B
Painting
The
Wall
概率DP
Codeforce
s 目录
Codeforce
sRound#277(Div.2)
Codeforce
sRound#276(Div.2)
Codeforce
sRound#275(Div.2)
Codeforce
sRound#274(Div
CHEBEATER
·
2020-09-12 07:32
Codeforces补番
Codeforces跟番
codeforce
259A 最新题解 第二场
/*
codeforce
259A该题意思非常简单,表示没看题,直接看输入输出,直接拍下代码,已AC应该比较简单的,就是注意控制好几个for循环的范围即可,代码写的有点乱,如果有问题请各位大神多多指出,本人将不胜感激具体见代码
Geek Panda
·
2020-09-12 07:32
Codeforce
s Round 444 div2 D two pointer + 贪心
D.RatingsandRealityShowstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTherearetwomainkindsofeventsinthelifeoftop-model:fashionshowsandphotoshoots.Particip
三级头不怕通
·
2020-09-12 07:45
codeforces
【索引】
Codeforce
s Round #262 (Div. 2)
ProblemA:VasyaandSocks(460A)ProblemB:LittleDimaandEquation(460B)ProblemC:Present(460C)ProblemD:LittleVictorandSet(460D)ProblemE:RolandandRose(460E)
JeraKrs
·
2020-09-12 07:43
索引
Codeforce
s 398B Painting The Wall(dp)
题目链接:
Codeforce
s398BPaintingTheWall题目大意:给出n和m,表示在一个n*n的平面上有n*n个瓷砖,其中有m块已经涂色。
JeraKrs
·
2020-09-12 07:43
CF
动态规划-基础
GRADE:A
CodeForce
s 189 A
题目链接~~>做题感悟:比赛时做的这道题,开始想暴力但是因为近段时间在看背包,看见这题就想到用完全背包可以解决,但是做了两个小时也没做出来,最后想暴力但是暴力错了。解题思路:(1)暴力:给三个数排序,因为大的数需要的总个数少,所以遍历两个大的数(两层for循环,已经知道两个大的数,小的数可以解出来)。(2)完全背包:必须恰好装满,所以初始化很重要(背包总结),然后以个数为价值,尽量选价值多,容量为
Bjut_Search2016
·
2020-09-12 07:42
ACM算法
CodeForce
s 275C 贪心
Ak-multiplefreesetisasetofintegerswherethereisnopairofintegerswhereoneisequaltoanotherintegermultipliedbyk.Thatis,therearenotwointegersxandy(x #include#include#includeusingnamespacestd;intn,k,i,j;long
lab104_yifan
·
2020-09-12 07:11
CodeForce
s 919B(枚举)
题目链接:点击打开链接题目大意:输入一个k,找到第K个满足各位相加等于10的数字题目思路:纸上写一下就会发现前一百每个数字之间隔9,然后过了100以后有时候会隔9不满足,但是没关系,check一下就好了以下是代码:#include#includeusingnamespacestd;boolcheck(intx){intk=x,sum=0;while(k!=0){sum+=k%10;k/=10;}i
smilestruggler
·
2020-09-12 07:57
枚举
上一页
66
67
68
69
70
71
72
73
下一页
按字母分类:
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
其他