
acm
油醋三椒
StuTan
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #624 (Div. 3) B. WeirdSort
B. WeirdSorttime limit per test2 secondsmemory limit per test256 megabytesProblemYou are given an array a of length n.You are also given a set of distinct positions p1,p2,…,pm, where 1≤pi<n. T...原创 2020-02-27 21:45:36 · 356 阅读 · 0 评论 -
书上博弈
1. 题目描述2. 说明分析当游戏输掉时,自己的唯一一条边有另一个人,那么自己一定是在叶子上。令两个人之间的距离为D。但是,每人行动后D会增加1或减少1。 因此,每有人走一步,D的奇偶性都会改变。假设最初,在牛牛移动之前,D是偶数。 那么当牛牛移动时D将始终为偶数,而当牛妹移动时D将始终为奇数。当牛牛和牛妹的令牌位于相邻的节点中时,D=1。因此,如果D为偶数,则他们不在相邻的单元格中,...原创 2020-02-12 12:32:05 · 273 阅读 · 0 评论 -
子段异或(输出异或值为0的不同子段的数量)
1.题目描述2.分析说明亦或运算中当且仅当 a ^ a = 0,连续一段的运算a[0] ^ …a[i] ^ a[i+1] ^ … ^ a[i+k] ^ … ^a[n] 中若出现相同的亦或前缀和,如a[0] ^ … ^ a[i]的亦或前缀和 与 a[0] ^ … ^ a[i+k]的亦或前缀和相等,则a[i+1] ^ … ^ a[i+k]=0如 1 2 3 2 1 中 有1^ 2=3,...原创 2020-02-12 10:27:13 · 751 阅读 · 2 评论 -
牛牛的K合因子数
1.题目描述2.解释说明假设 2 - n 的每一个数都是素数(true), 然后从2开始进行判断,如果 2 是素数,则将2的2倍、3倍、4倍······等小于等于n的数都置为 false , 这样就相当于判断了每一个数是否为素数;如果当前数是合数,则它本身的2倍、3倍、4倍······等小于等于n的数都将新增加一个合数因子,所以用数组不断累加,则该数组 (c[]) 记录了每一个数的合数因子个数...原创 2020-02-11 11:00:45 · 251 阅读 · 0 评论 -
2019牛客暑期多校训练营(第七场)D Number
D Number链接:https://ac.nowcoder.com/acm/contest/887/D题目描述I have a very simple problem for you. Given a positive integeter n\ (1 \leq n \leq 1000000)n (1≤n≤1000000) and a prime number p (2≤p≤1000000)...原创 2019-08-08 17:19:16 · 315 阅读 · 0 评论 -
2019牛客暑期多校训练营(第七场) B Irreducible Polynomial
B Irreducible PolynomialProblemIn mathematics, a polynomial is an expression consisting of variables (also called indeterminate) and coefficients, that involves only the operations of addition, subt...原创 2019-08-08 17:06:05 · 264 阅读 · 0 评论 -
递推算法
PathTime limit: 1 second Memory limit: 256 megabytestitleYears later, Jerry fell in love with a girl, and he often walks for a long time to pay visits to her. But, because he spends too much time w...原创 2019-08-02 09:37:39 · 142 阅读 · 0 评论 -
Catalan 数
简介卡特兰数又称卡塔兰数,英文名Catalan number, 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 3...原创 2019-08-01 16:55:24 · 343 阅读 · 0 评论 -
2019牛客暑期多校训练营(第五场)A digits
Digitis链接:https://ac.nowcoder.com/acm/contest/885/AProblem descriptionYou are given a positive integer n which is at most 100.Please find a positive integer satisfying the following conditions:...原创 2019-08-01 14:22:31 · 153 阅读 · 0 评论 -
2019牛客暑期多校训练营(第七场)J A+B problem
J A+B problem链接:https://ac.nowcoder.com/acm/contest/887/J来源:牛客网题目描述Reversed number is a number written in arabic numerals but the order of digits is reversed. The first digit becomes last and vice...原创 2019-08-08 17:29:48 · 405 阅读 · 0 评论 -
2019 Multi-University Training Contest 6 TDL
TDLTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionFor a positive integer n, let’s denote...原创 2019-08-07 15:43:47 · 250 阅读 · 0 评论 -
2019 Multi-University Training Contest 6 Stay Real
Stay RealTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionIn computer science, a heap is a...原创 2019-08-07 15:58:03 · 237 阅读 · 0 评论 -
2019 Multi-University Training Contest 5 permutation 2
permutation 2Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1458 Accepted Submission(s): 688Problem DescriptionYou are given three pos...原创 2019-08-07 16:33:15 · 148 阅读 · 0 评论 -
2019 Multi-University Training Contest 8 Calabash and Landlord
Calabash and LandlordProblem DescriptionCalabash is the servant of a landlord. The landlord owns a piece of land, which can be regarded as an infinite 2D plane.One day the landlord set up two ortho...原创 2019-08-14 20:51:20 · 237 阅读 · 0 评论 -
2019 Multi-University Training Contest 8 Quailty and CCPC
Quailty and CCPCProblem DescriptionConsidering the overall difficulty of other problems, we invite Quailty to propose an easy problem for this contest.Quailty accidentally won both gold medal and s...原创 2019-08-14 20:56:42 · 262 阅读 · 0 评论 -
2019 Multi-University Training Contest 8 Roundgod and Milk Tea
Roundgod and Milk TeaProblem DescriptionRoundgod is a famous milk tea lover at Nanjing University second to none. This year, he plans to conduct a milk tea festival. There will be n classes particip...原创 2019-08-14 21:00:08 · 350 阅读 · 2 评论 -
Codeforces Round #576 (Div. 2) C MP3
C. MP3 One common way of digitalizing sound is to record sound intensity at particular ...原创 2019-08-01 11:13:29 · 139 阅读 · 0 评论 -
平面分割
平面分割令第n条直线分割的平面数是f(n),则f(1)=2 故有 f(n)=f(n-1)+n.原创 2019-08-01 10:25:31 · 913 阅读 · 0 评论 -
C++常用函数库
C++常用库函数常用数学函数头文件 #include 或者 #include <math.h>函数原型 功能 返回值int abs(int x) 求整数x的绝对值 绝对值double acos(double x) 计算arcos(x)的值 计算结果double asin(double x) 计算arsin(x)的值 计算结果double atan(...转载 2019-07-24 14:32:31 · 1796 阅读 · 0 评论 -
char、int、short、float等数据类型的最大值和最小值
folat.h里的函数使用:float.h是C标准函式库中的头文件,定义了浮点类型的一些极限值。双精度浮点类型DBL_DIG 十进制的精度位数:15DBL_EPSILON 保持运算的最小值:2.2204460492503131e-016DBL_MANT_DIG 尾数的位数:53DBL_MAX 最大值:1.7976931348623158e+308DBL_MAX_10_EXP 10进制...转载 2019-07-24 16:49:49 · 27339 阅读 · 0 评论 -
1009 Budget
1009 BudgetProblem DescriptionAvin’s company has many ongoing projects with different budgets. His company records the budgets using numbers rounded to 3 digits after the decimal place. However, the...原创 2019-07-24 18:09:18 · 290 阅读 · 0 评论 -
Codeforces 7-24 div3 RGB Substring
RGB Substring (easy version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputproblemYou are given a string s consisting of n characters, each...原创 2019-07-25 11:29:42 · 294 阅读 · 0 评论 -
2019 Multi-University Training Contest 3 Fansblog
Fansblog原创 2019-07-30 15:51:34 · 270 阅读 · 0 评论 -
快速幂和快速乘(加模除)
代码#include<bits/stdc++.h>using namespace std;long long mul(long long a,long long b,long long mod){//快速乘 long long ret=0; while(b) { if(b & 1) { ret += a; ...原创 2019-07-30 16:17:12 · 261 阅读 · 0 评论 -
2019牛客暑期多校训练营(第四场)K number
Numberproblem链接链接:https://ac.nowcoder.com/acm/contest/884/K来源:牛客网300iq loves numbers who are multiple of 300.One day he got a string consisted of numbers. He wants to know how many substrings in...原创 2019-07-30 16:38:31 · 233 阅读 · 0 评论 -
2019 牛客暑期多校训练营(第四场)J Free
链接:https://ac.nowcoder.com/acm/contest/884/J来源:牛客网题目描述Your are given an undirect connected graph.Every edge has a cost to pass.You should choose a path from S to T and you need to pay for all the e...转载 2019-07-30 17:08:58 · 342 阅读 · 0 评论 -
Codeforces 7-24 div3 RGB Substring(hard version)
RGB Substring (hard version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe only difference between easy and hard versions is the size of...原创 2019-07-25 21:29:52 · 204 阅读 · 0 评论 -
2019牛客暑期多校训练营(第六场)A Garbage Classification
链接:https://ac.nowcoder.com/acm/contest/886/AproblemOn the CVBB planet, garbage classification has been gradually executed to help save resources and protect the environment. Nowadays people have to ...原创 2019-08-03 13:20:25 · 583 阅读 · 0 评论 -
Codeforces Round #575 (Div. 3) E Connected Component on a Chessboard
Connected Component on a Chessboardtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputproblemYou are given two integers b and w. You have a che...原创 2019-07-26 10:32:40 · 194 阅读 · 0 评论 -
求两个数的最大公约数和最小公倍数
最大公约数和最小公倍数原创 2019-07-23 10:39:11 · 358 阅读 · 0 评论 -
Hanoi 问题
Hanoi 塔Problem Description在柱子A上有 n 个 盘子,按从小到大的顺序从上到下排列,要将其移到柱子 C 上,可以借助 B 柱子,其中 B 柱子和 C 柱子都是空的。要求:每次只能移动一个盘子每根柱子上的盘子都必须按照从小到大从上到下的顺序排列分析当A上面有N个盘子,如果我把N-1个盘子已经搬到了B上面,我只需要将A上的最后一个盘子放到C上面,第N个盘子的...原创 2019-08-01 10:02:40 · 397 阅读 · 0 评论 -
Fibonacci 数列
Fibonacci 数列Fibonacci 数列在狭义上是指:数列的第一个和第二个的值均为1,接下来的每个数都是前两个数之和在广义上是指:数列的第一个和第二个的值均确定,接下来的每个数都是前两个数之和这种从前往后的递推形式,即,a[n+2]=a[n+1]+a[n] a [n + 2 ] = a [ n + 1 ] + a [ n ]a[n+2]=a[n+1]+a[n]这是典型的递推格式...原创 2019-08-01 10:05:25 · 419 阅读 · 0 评论 -
HDU 6573 Traffic
TrafficTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 KProblem DescriptionAvin is observing the cars at a crossroads. He finds that there are n cars running in the east-west dir...原创 2019-07-23 14:36:04 · 768 阅读 · 0 评论 -
对一个浮点数保留两位小数
输出时对小数保留两位小数对一个小数 s 来说,可以通过以下方式来转化float s= 456.125754;s=( (float)( (int)( (s+0.005)*100 ) ) ) /100;//s=456.13但,通过这种方式转化,若是小数位为 0 的话,将不会显示也可以直接输出时printf(" % .2f \n " , s ); //s=456.13当然,如果你想...原创 2019-07-24 11:19:37 · 21538 阅读 · 1 评论