
补题知识点
为啥不能重名
这个作者很懒,什么都没留下…
展开
-
天梯赛补题:L3-021 神坛 (30 分)
在古老的迈瑞城,巍然屹立着 n 块神石。长老们商议,选取 3 块神石围成一个神坛。因为神坛的能量强度与它的面积成反比,因此神坛的面积越小越好。特殊地,如果有两块神石坐标相同,或者三块神石共线,神坛的面积为 0.000。长老们发现这个问题没有那么简单,于是委托你编程解决这个难题。输入格式:输入在第一行给出一个正整数 n(3 ≤ n ≤ 5000)。随后 n 行,每行有两个整数,分别表示神石的横坐标、纵坐标(−109 ≤ 横坐标、纵坐标 <109 )。输出格式:在一行中输出神原创 2021-04-07 20:54:45 · 597 阅读 · 0 评论 -
补题:G - Galactic Collegiate Programming Contest
从这个题学到了一些关于set的知识点,在自己另一个博客总结了一点,之前一直没做出来,是因为在set中不会删除全部元素,通过学习这篇博客https://blog.youkuaiyun.com/bbbbswbq/article/details/79839832我总结了一些set的知识点下面是ac代码:#include <bits/stdc++.h>using namespace std;struct node{ int id,s,t; bool operator<(con.原创 2021-03-27 20:24:33 · 149 阅读 · 0 评论 -
L2-012 关于堆的判断 (25 分)
将一系列给定数字顺序插入一个初始为空的小顶堆H[]。随后判断一系列相关命题是否为真。命题分下列几种:x is the root:x是根结点;x and y are siblings:x和y是兄弟结点;x is the parent of y:x是y的父结点;x is a child of y:x是y的一个子结点。输入格式:每组测试第1行包含2个正整数N(≤ 1000)和M(≤ 20),分别是插入元素的个数、以及需要判断的命题数。下一行给出区间[−10000,10000]内的N个要被插入一个初始为原创 2021-03-26 15:25:14 · 298 阅读 · 0 评论 -
求逆元的算法
求乘法逆元的目的(作用):除以一个数然后取模时,我们可以转化为乘以这个数的逆元然后取模。(类似于:要计算3/4,那么我们可以转变为3*(1/4))由于(a/b)%mod并不等价于(a%mod)/(b%mod)%mod,所以,在计算(a/b)%mod时,我们应该转换为(a*b-1)%mod,b-1指的就是b的逆元。下面就自然引入求逆元的算法:long long Mode(long long a, long long b, long long mode)//快速幂算法{ long long su原创 2021-02-18 11:26:09 · 218 阅读 · 0 评论 -
Problem B
题目描述You are given a list of integers x1, x2, . . . , xn and a number k. It is guaranteed that each i from 1 to k appears in thelist at least once.Find the lexicographically smallest subsequence of x that contains each integer from 1 to k exactly once.输原创 2021-01-25 11:13:16 · 139 阅读 · 0 评论 -
祖冲之点集
在平面上有n个点所组成的点集,如果以点集中任意两点为端点的线段的垂直平分线都经过点集中至少一点,那么这个点集就叫做n点的"祖冲之点集"引申之意:也就是说,必存在n(n>=3)个点,其中n个点中任意两点的垂直平分线过第三点。...原创 2020-10-05 19:36:24 · 176 阅读 · 0 评论 -
Codeforces Round #694 (Div. 2)
A题大意:我们可以在这个数组上执行一种操作,即用相邻两个数的和代替这两个数,例如[3,6,9],如果操作前两个数,那么数组就会变成[15,9]。输入两个整数,n和x,接下来输入一组数据,这组数据长度为n。输出执行上述操作后,数组中的数据除以x(向上取整),并且相加后得到的最大值和最小值。分析:最大值即为所有数字除以x(向上取整)之后相加的和,最小值即为所有数字相加后除以x(向上取整)之后的的和。代码:#include <iostream>#include <cstring&..原创 2021-01-21 16:51:44 · 111 阅读 · 0 评论 -
Pursuing the Happiness
分析:由于数据量较小,直接暴力即可,不需要KMP算法,易错点:如果原字符串中有两个子字符串,可以交换第一个子字符串的’h’与第二个子字符串的’a’,如果超过三个子字符串必不能实现仅仅交换两个位置就满足要求,如果只有一个子字符串,就交换’h’和’a’即可,如果没有子字符串,那就必要小心,如果任意交换两个字符,可能会生成“happiness”,例如:“haapiness”,如果交换第一个’h’和第一个’a’,就会生成“happiness”,如果原字符串(不含子字符串)可能会通过交换两个位置上的字符生成子字符串.原创 2021-01-20 11:10:51 · 134 阅读 · 0 评论 -
E - Expeditious Cubing Kattis - expeditiouscubing【浮点数处理】
Your friend Claire has dragged you along to a speedcubing event that is happening in Eindhoven. These events are all about solving the Rubik’s cube and similar twisty puzzles as quickly as possible. The attendants of the event can enter into various compet原创 2020-12-14 20:20:59 · 365 阅读 · 0 评论 -
F - Firetrucks Are Red Kattis - firetrucksarered(并查集加路径压缩)
Lily is fascinated by numbers. She believes the whole world revolves around them, and that everything is connected by numbers. Her friends, Alice, Bob, Charlie and Diane, are not convinced. But she gives them an example:Alice lives in house number 25 on h原创 2020-12-14 20:14:19 · 333 阅读 · 0 评论 -
C - Canvas Line Kattis - canvasline(细节题)
Your friend Charmion asked you to hang some canvases out to dry on a straight washing line for an art project she has been working on. The canvases are artfully arranged such that none of them overlap, although they may touch along the edges. For stability原创 2020-12-14 20:09:56 · 381 阅读 · 0 评论 -
Gym - 102059H 思维题
题目链接:https://codeforces.com/gym/102059/problem/H思路:采取倒推的手段,我们根据题目给出的条件,可以知道(x+y)/gcd(x,y)<1000,那么x/gcd(x,y)+y/gcd(x,y)<1000,两个互质的数相加小于1000,那么这两个数一定都小于1000且互质,我们假设x/gcd(x,y)=i,y/gcd(x,y)=j,那么题目就转换成了在1000内找两个互质的数,并且在给定的范围内满足a<=igcd(x,y)<=b且c<原创 2020-12-05 20:25:19 · 180 阅读 · 0 评论 -
D - Fall Guys Gym - 102801D【待修改】
Fall GuysFall Guys is a recently popular game. There are at most 60 players participating in a game and only one player will win finally after passing through one level after another.Fall Guys has a level named climbing competition. Players will reach th原创 2020-11-06 20:21:21 · 441 阅读 · 0 评论 -
C - Car HDU - 5935
Ruins is driving a car to participating in a programming contest. As on a very tight schedule, he will drive the car without any slow down, so the speed of the car is non-decrease real number.Of course, his speeding caught the attention of the traffic pol原创 2020-11-06 17:02:01 · 181 阅读 · 0 评论 -
Sigma Function LightOJ - 1336
题目链接:https://vjudge.net/problem/LightOJ-1336Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For example σ(24) = 1+2+3+4+6+8+12+24=原创 2020-11-06 15:34:27 · 101 阅读 · 0 评论 -
G - Halli Galli Gym - 102801G
Now there are K people play Halli Galli game.They will play N turns in all,in the order of the first player,the second player,⋯,the K player,the first player,⋯.In one turn,the player will display a card on his side,if there are akinds of fruit which its原创 2020-11-02 16:02:30 · 618 阅读 · 0 评论 -
ceil()函数
ceil()函数为向上取最接近的整数floor()函数为向下取最接近的整数round()函数是对浮点数四舍五入原创 2020-10-28 19:54:23 · 135 阅读 · 0 评论 -
Fraction Comparision (分数比较)
链接:https://ac.nowcoder.com/acm/contest/8409/F来源:牛客网链接:https://ac.nowcoder.com/acm/contest/8409/F来源:牛客网Bobo has two fractions xa\frac{x}{a}ax and yb\frac{y}{b}by. He wants to compare them. Find the result.输入描述:The input consists of several test case原创 2020-10-24 19:40:26 · 215 阅读 · 0 评论 -
求一个序列所有区间不同数的个数之和
题目链接:牛客网-BGromah and LZR have entered the second level. There is a sequence a1,a2,⋯ ,an on the wall.There is also a note board saying “the beauty value of a sequence is the number of different elements in the sequence”.LZR soon comes up with the passwor原创 2020-10-24 17:10:10 · 238 阅读 · 0 评论 -
利用海伦公式求三角形面积
海伦公式:假设在平面内,有一个三角形,边长分别为a、b、c,三角形的面积S可由以下公式求得:而公式里的p为半周长(周长的一半)求三角形内切圆和外切圆的半径:内切圆:三角形内切bai圆半径:r=2S/(a+b+c)外切圆:三角形外接圆的半径:R=abc/4S例题:F - 程序设计:掎角之势 计蒜客 - A2226在《亮剑》中,李云龙发动的平安战役不仅把晋西北搅成一锅粥,还成为了第二次世界大战的转折点。晋绥军 358团楚云飞得到探报,有大批日军向平安县城移动,于是他准备帮帮场子。友军在平安附近原创 2020-10-23 17:23:59 · 1451 阅读 · 0 评论 -
A - 结果填空:阶乘位数 计蒜客 - A2221
蒜头君对阶乘产生了兴趣,他列出了前 10个正整数的阶乘以及对应位数的表:nn!位数1 1 12 2 13 6 14 24 25 120 36 720 37 5040 48 40320 59 362880 610 3628800 7对于蒜头君来说,再往后就很难计算了。他试图寻找阶乘位数的规律,但是失败了。现在请你帮他计算出第一个正整数的阶乘位数大于等于 10000的数是多少,即求最小的正整数 n 满足 n! 的位数大于等于 10000。原创 2020-10-12 17:19:26 · 258 阅读 · 0 评论