
ICPC
文章平均质量分 81
z岁月无声
这个作者很懒,什么都没留下…
展开
-
2017年ICPC中国大陆区域赛真题(上)-G - Rake It In
地址:https://vjudge.net/contest/331385#problem/G提交地址:https://nanti.jisuanke.com/t/A1538思路:DFSCode:#include<iostream>#include<algorithm>#include<cstring>using namespace std;...原创 2019-11-05 19:53:08 · 331 阅读 · 0 评论 -
2018年icpc南京站 J-Prime Game
思路:博客:https://www.cnblogs.com/dilthey/p/9985010.html考虑每个质因子对于整体答案的贡献。拿第二组样例算一算就不难发现:第pp个位置上的数,其包含的任意一个素因子,它原本应当产生的贡献有(n−p+1)⋅p(n−p+1)⋅p,但是考虑到若其前面出现过一样的素数,那么应当减去一些重复计算的区间。假设它前面的和它一样的素数,最后一...转载 2019-08-28 15:12:25 · 214 阅读 · 0 评论 -
2018年ACM-ICPC 南京现场赛 A.Adrien and Austin
思路:博弈,对于k>1的情况,先手总可以将n个连续石子分成两堆相同的石子堆,然后根据对称性和后手取一样的石子就能够保证赢,对于k=1的情况,显然判断下n的奇偶即可,注意n=0的情况Code :#include<iostream>#include<algorithm>#include<cstring>using namespace std...原创 2019-08-28 14:42:38 · 286 阅读 · 0 评论 -
2018icpc南京现场赛-G Pyramid(找规律)
题意:求n行三角形中等边三角形个数,图二的三角形也算。n<=1e9思路:通过找规律,然后列方程求出未知数,秒啊博客https://www.cnblogs.com/wrjlinkkkkkk/p/10041144.html打表找下规律,打表方法:把所有点扔坐标系里n^3爆搜即可打出来为 1,5,15,35,70,126,210..没感觉,作差 4, 10, 20...转载 2019-08-27 17:51:39 · 1085 阅读 · 0 评论 -
2019 ICPC World Finals -A-Azulejos
地址:https://judge.icpc.global/problems/azulejos题目大意:有两排盘子,盘子有价格pi和高度hi。盘子的放置规则为:每排的盘子按照价格从小到大排列,对于第二排的盘子的高度必须比第一排对于列的盘子高度高(h2i>h1i)输入每排盘子的个数 n第二排盘子的价格第二排盘子的高度第一排盘子的价格第一排盘子的高度输出若能够按...原创 2019-04-05 13:37:06 · 2029 阅读 · 0 评论 -
HDU-6223 Infinite Fraction Path(2017ACM/ICPC亚洲区沈阳站)
地址:http://acm.hdu.edu.cn/showproblem.php?pid=6223思路:BFS+剪枝。对于每一层,找其最大值mm,对于小于mm的点和找的可能为同一个点进行剪枝。Code:#include<iostream>#include<cstdio>#include<queue>using namespace std;...原创 2018-10-31 13:17:58 · 327 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛-B-Mathematical Curse
A prince of the Science Continent was imprisoned in a castle because of his contempt for mathematics when he was young, and was entangled in some mathematical curses. He studied hard until he reached ...原创 2018-09-19 22:04:41 · 255 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛-L- Poor God Water
God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them poisonous.Every hour, God Water will eat one kind of fo...原创 2018-09-19 20:59:19 · 217 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛-K-Transport Ship
There are NN different kinds of transport ships on the port. The i^{th}ith kind of ship can carry the weight of V[i]V[i] and the number of the i^{th}ith kind of ship is 2^{C[i]} - 12C[i]−1. How many d...原创 2018-09-19 20:55:25 · 228 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛-G-Give Candies
地址:https://nanti.jisuanke.com/t/31716思路:手算出n=4,5的结果可以发现 答案就是 2^(n-1) ,但是这里的 n<=10^100000就算用快速幂也会超时,因此需要用费马小定理: a^(p-1)=1 (mod p) ,将 n对(MOD-1)取模后-1 ,然后再用快速幂即可Code :#include<cstdio>#i...原创 2018-09-19 20:50:54 · 256 阅读 · 0 评论 -
ACM-ICPC 2018 徐州赛区网络预赛-G. Trace
There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xx , yy ) means the wave is a rectangle whose vertexes are ( 00 , 00 ), ( xx , 00 ), ( 00 , yy ), ( xx , yy ...原创 2018-09-10 13:39:36 · 286 阅读 · 0 评论 -
ACM-ICPC 2018 徐州赛区网络预赛- H. Ryuji doesn't want to study
Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, each book has its knowledge a[i]a[i].Unfortunately, the longer he learns, the fewer he gets.That m...原创 2018-09-10 13:25:38 · 240 阅读 · 0 评论