ACM
文章平均质量分 77
浩1001
这个作者很懒,什么都没留下…
展开
-
2018年湘潭大学程序设计竞赛-A 时间统计
原题链接: https://www.nowcoder.com/acm/contest/105/A时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld题目描述某个实验需要统计时间,记录了实验开始和结束的时间,计算实验用了多少秒。 输入描述:第一行输入一个整数n,表示样例个数。接下来每组样例两行,表示开始时间和结束...原创 2018-05-03 20:57:23 · 235 阅读 · 0 评论 -
Codeforces Round #485 (Div. 2) D. Fair
D. Fairtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputSome company is going to hold a fair in Byteland. There are nn towns in Byteland and mm two...原创 2018-05-31 01:09:29 · 215 阅读 · 0 评论 -
Codeforces Round #485 (Div. 2) E. Petr and Permutations
E. Petr and Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetr likes to come up with problems about randomly generated data. This ti...原创 2018-05-31 01:17:45 · 439 阅读 · 0 评论 -
2018 Multi-University Training Contest 3 Problem D. Euler Function
原题:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1004&cid=804 Problem DescriptionIn number theory, Euler's totient function φ(n) counts the positive integers up to a given intege...原创 2018-07-30 21:01:35 · 134 阅读 · 0 评论 -
2018 Multi-University Training Contest 3 Problem L. Visual Cube
原题:http://acm.hdu.edu.cn/showproblem.php?pid=6330Problem DescriptionLittle Q likes solving math problems very much. Unluckily, however, he does not have good spatial ability. Everytime he meets a ...原创 2018-07-30 21:09:19 · 236 阅读 · 0 评论 -
2018 Multi-University Training Contest 3 Problem F. Grab The Tree
原题:http://acm.hdu.edu.cn/showproblem.php?pid=6324 Problem DescriptionLittle Q and Little T are playing a game on a tree. There are n vertices on the tree, labeled by 1,2,...,n, connected by n−1 ...原创 2018-07-30 21:19:32 · 224 阅读 · 0 评论 -
Wannafly挑战赛21 C大水题
原题:https://www.nowcoder.com/acm/contest/159/C 题目描述现在给你N个正整数ai,每个数给出一“好数程度” gi(数值相同但位置不同的数之间可能有不同的好数程度)。对于在 i 位置的数,如果有一在j位置的数满足 j < i 且 ai=aj,则你可以将位于[i,j]闭区间内的序列评为“好序列”,然后获得∑gk(j≤k≤i)(此闭区间内“好数...原创 2018-08-04 11:29:17 · 302 阅读 · 3 评论 -
2018百度之星资格赛 1002子串查询
Problem Description度度熊的字符串课堂开始了!要以像度度熊一样的天才为目标,努力奋斗哦!为了检验你是否具备不听课的资质,度度熊准备了一个只包含大写英文字母的字符串 A[1,n] = a_1 a_2 \cdots a_nA[1,n]=a1a2⋯an,接下来他会向你提出 qq 个问题 (l,r)(l,r),你需要回答字符串 A[l,r] = a_l a_{l...原创 2018-08-04 20:25:22 · 878 阅读 · 0 评论 -
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 A Fruit Ninja
原题:https://www.nowcoder.com/acm/contest/163/A题目描述Fruit Ninja is a juicy action game enjoyed by millions of players around the world, with squishy,splat and satisfying fruit carnage! Become the ul...原创 2018-08-05 21:11:50 · 301 阅读 · 0 评论 -
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 D-Thinking-Bear magic
链接:https://www.nowcoder.com/acm/contest/163/D来源:牛客网 题目描述In order to become a magical girl, Thinking-Bear are learning magic circle.He first drew a regular polygon of N sides, and the length of ...原创 2018-08-05 21:18:15 · 389 阅读 · 0 评论 -
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 J-Beautiful Numbers
链接:https://www.nowcoder.com/acm/contest/163/J 题目描述NIBGNAUK is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisib...原创 2018-08-05 21:28:38 · 222 阅读 · 0 评论 -
HDU6335 Problem D. Nothing is Impossible
原题:http://acm.hdu.edu.cn/showproblem.php?pid=6335Problem Descriptionm students, including Kazari, will take an exam tomorrow.The paper consists of exactly n problems, the i-th problem contains ai...原创 2018-08-01 21:44:51 · 422 阅读 · 0 评论 -
HDU6336 Problem E. Matrix from Arrays
Problem DescriptionKazari has an array A length of L, she plans to generate an infinite matrix M using A.The procedure is given below in C/C++:int cursor = 0;for (int i = 0; ; ++i) { for (i...原创 2018-08-01 21:51:19 · 397 阅读 · 0 评论 -
HDU6342 Problem K. Expression in Memories
原题:http://acm.hdu.edu.cn/showproblem.php?pid=6342Problem K. Expression in MemoriesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 422 ...原创 2018-08-01 22:00:07 · 186 阅读 · 0 评论 -
HDU6343 Problem L. Graph Theory Homework
原题:http://acm.hdu.edu.cn/showproblem.php?pid=6343 分析:签到题,直接拿第一个数和最后一个数进行运算即可,记得向下取整。#include<bits/stdc++.h>using namespace std;const int maxn = 100000+100;int a[maxn];int t, n, m;...原创 2018-08-01 22:03:21 · 149 阅读 · 0 评论 -
HDU6386-Age of Moyu
Age of MoyuTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 970 Accepted Submission(s): 264 Problem DescriptionMr.Quin love fishes s...原创 2018-08-13 20:48:17 · 312 阅读 · 0 评论 -
HDU-6395-Sequence (矩阵快速密, 加整数分块)
原题:http://acm.hdu.edu.cn/showproblem.php?pid=6395分析:题意是给一个了数列递推式,问第n项取模的值。这道题的范围很大所以没法使用直接跑循环地推的方法求第n项,很容易就能分析出应该转化成矩阵的方法,然后使用矩阵快速密来求解第n项的值。题目给的递推式是一个非线性的关系,所以一开始就想转化成线性关系然后再将转移矩阵求出来,但是这道题没法转化成线性关...原创 2018-08-14 01:50:54 · 501 阅读 · 0 评论 -
Codeforces Round #485 (Div. 2) C. Three displays
C. Three displaystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt is the middle of 2018 and Maria Stepanovna, who lives outside Krasnokamensk (a ...原创 2018-05-31 01:03:30 · 138 阅读 · 0 评论 -
Codeforces Round #485 (Div. 2) B. High School: Become Human
B. High School: Become Humantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYear 2118. Androids are in mass production for decades now, and they do...原创 2018-05-31 00:58:03 · 164 阅读 · 0 评论 -
codeforces 527 C. Glass Carving
http://codeforces.com/problemset/problem/527/CC. Glass Carvingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLeonid wants to become a glass carve...原创 2018-03-19 23:31:02 · 319 阅读 · 0 评论 -
URAL 1989. Subpalindromes
原题连接:http://blog.csdn.net/zearot/article/details/38921403题目大意:给定一个字符串,然后有两个操作: 一为修改这个字符串中的任意一个字符, 二为选择其中一个子串,从j到k,判断str[j.....k]这个子串是不是回文串。题解:这道不能直接用暴力判断子串是不是回文,这样会超时...原创 2018-03-18 20:54:53 · 233 阅读 · 0 评论 -
2018年湘潭大学程序设计竞赛 C Boom(区间覆盖)
链接:https://www.nowcoder.com/acm/contest/105/C来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld题目描述紧急事件!战场内被敌军埋放了n枚炸弹! 我军情报部门通过技术手段,掌握了这些炸弹的信息。这些炸弹很特殊,每枚炸弹的波及区域是一个矩形。第i枚炸弹的波及...原创 2018-05-03 21:04:22 · 204 阅读 · 1 评论 -
2018年湘潭大学程序设计竞赛 D Fibonacci进制(贪心,斐波那契)
链接:https://www.nowcoder.com/acm/contest/105/D来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld题目描述 Fibonacci数是非常有名的一个数列,它的公式为 f(n)=f(n-1)+f(n-2),f(0)=1,f(1)=2。 我们可以把任意一...原创 2018-05-03 21:10:19 · 277 阅读 · 0 评论 -
2018年湘潭大学程序设计竞赛 E 吃货(贪心,二分)
链接:https://www.nowcoder.com/acm/contest/105/E来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld题目描述作为一个标准的吃货,mostshy又打算去联建商业街觅食了。 混迹于商业街已久,mostshy已经知道了商业街的所有美食与其价格,而且他给每种美食都赋...原创 2018-05-03 21:18:03 · 271 阅读 · 0 评论 -
牛客小白月赛3 A音标
链接:https://www.nowcoder.com/acm/contest/87/A来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld题目描述 我们规定元音字母有a、e、i、o、u,并且规定半元音字母y也是元音字母。 Cwbc在学习英语,XHRlyb为了让Cwbc的记忆更加深刻,于是她...原创 2018-05-12 23:28:09 · 185 阅读 · 0 评论 -
牛客小白月赛3 H纪年
链接:https://www.nowcoder.com/acm/contest/87/H来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld题目描述Cwbc和XHRlyb在学习干支纪年法。 干支纪年法是中国历法上自古以来就一直使用的纪年方法。干支是天干和地支的总称。甲、乙、丙、丁、戊、己、庚、辛、壬...原创 2018-05-12 23:30:58 · 238 阅读 · 0 评论 -
牛客小白月赛3 F异或
链接:https://www.nowcoder.com/acm/contest/87/F来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld题目描述Cwbc想测试一下他的加密协议,以便防止其他人偷看他给XHRlyb的信。 Cwbc提出了这样一个问题:在区间[a,b]和区间[c,d]中分别等概率随机选...原创 2018-05-12 23:33:22 · 304 阅读 · 0 评论 -
2018广东省ACM省赛(GDCPC) 赛后
第二次参加省赛,去年作为大一的萌新参加了一次省赛,作为弱校的一支队伍,理所当然的打铁了。 今年参加队伍的心态比较好,在加上临时换了个比较有经验的队友,心态更加平和了,5号的时候跑去华工校区签到,过去试了一下机,草草的做了两道题以后就听到说E盘不会清空,然后就不做题了,跑去敲模板去了,一上来先敲了个线代树的模板,然后就不想敲了,和另外两对的同学聊一聊就回学校了。 第二天比赛开始的...原创 2018-05-08 01:11:35 · 2022 阅读 · 0 评论 -
最短路径Dijkstra的两种实现方法
1、Dijkstra单源最短路,邻接矩阵形式(权值是非负)/* 单源最短路径,Dijkstra算法,邻接矩阵形式,复杂度为O(n^2) 求出源beg到所有点的最短路径,传入图的顶点数,和邻接矩阵cost[][] 返回个点的最短路径dist[],路径pre[].pre[i]记录beg到i路径上的父结点,pre[beg]=-1 可更改路径权类型,但是权值必须为非负*/const int ...原创 2018-05-08 19:09:47 · 368 阅读 · 0 评论 -
POJ 1740--A New Stone Game(博弈)
原题连接:http://poj.org/problem?id=1740A New Stone GameTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 6327 Accepted: 3455DescriptionAlice and Bob decide to play a new stone game.At the beginnin...原创 2018-05-25 22:48:16 · 202 阅读 · 0 评论 -
POJ 1067--取石子游戏 (威佐夫博弈)
原题链接:http://poj.org/problem?id=1067取石子游戏Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 44733 Accepted: 15227Description有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以...原创 2018-05-25 23:23:56 · 165 阅读 · 0 评论 -
LightOJ 1315 - Game of Hyper Knights (博弈论-SG函数)
原题连接:http://www.lightoj.com/volume_showproblem.php?problem=13151315 - Game of Hyper Knights PDF (English)StatisticsForumTime Limit: 1 second(s)Memory Limit: 32 MBA Hyper Knight is like a chess knigh...原创 2018-05-22 15:26:50 · 488 阅读 · 0 评论 -
乘法逆元、逆元应用、求逆元(费马小定理,扩展欧几里得)
乘法逆元对于缩系中的元素,每个数a均有唯一的与之对应的乘法逆元x,使得ax≡1(mod n)一个数有逆元的充分必要条件是gcd(a,n)=1,此时逆元唯一存在 逆元的含义:模n意义下,1个数a如果有逆元x,那么除以a相当于乘以x。逆元的应用当求解公式:(a/b)%m 时,因b可能会过大,会出现爆精度的情况,所以需变除法为乘法:设c是b的逆元,则有b*c≡1(mod m);则(a/b)%m = (a...原创 2018-05-26 20:51:30 · 819 阅读 · 0 评论 -
Wannafly挑战赛16 A-取石子
链接:https://www.nowcoder.com/acm/contest/113/A题目描述给出四堆石子,石子数分别为a,b,c,d。规定每次只能从堆顶取走石子,问取走所有石子的方案数。输入描述:在一行内读入四个由空格分隔的整数a,b,c,d, 输入均为不超过500的正整数输出描述:输出一个整数表示答案,答案对109+7取模示例1输入3 5 4 2输出2522520备注:输入均为不超过500...原创 2018-05-26 21:00:15 · 177 阅读 · 0 评论 -
Codeforces Round #485 (Div. 2) A. Infinity Gauntlet
A. Infinity Gauntlettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a...原创 2018-05-31 00:54:25 · 204 阅读 · 0 评论 -
ACM-ICPC 2018 徐州赛区网络预赛 A. Hard to prepare(dp)
链接:https://nanti.jisuanke.com/t/31453问题描述:n个人围在一起,每一个可以在2^k-1这些数种选择一个,不过要求保证相邻的两个数保证XNOR不为0,(1 XNOR 1 = 1, 0 XNOR 0=1, 1 XNOR 0 =0)。(0<n,k<1e6). 分析:规模这么大直接搜是不可能,所以要使用dp来做,然后分析相邻的两个数之间怎样才不为...原创 2018-09-09 18:00:35 · 465 阅读 · 1 评论