![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 65
samamthawyy
这个作者很懒,什么都没留下…
展开
-
Irreducible Polynomial(数学)
Irreducible Polynomial题目描述In mathematics, a polynomial is an expression consisting of variables (also called indeterminate) and coefficients, that involves only the operations of addition, subtraction, multiplication, and non-negative integer exponents原创 2021-08-19 17:47:47 · 348 阅读 · 0 评论 -
This Message Will Self-Destruct in 5s
This Message Will Self-Destruct in 5s题目描述You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.There are N attendees in the party, and原创 2021-08-19 17:27:39 · 150 阅读 · 0 评论 -
Peaks
Peaks题目描述There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, …, Obs. N. The elevation of Obs. i is Hi. There are also M roads, each connecting two different observatories. Road j connects Obs. Aj and Obs. Bj.Obs. i is said to be good when原创 2021-08-19 17:26:40 · 135 阅读 · 0 评论 -
基础算法——暑期打卡
刷题打卡快速排序1.第k个数第k个数Description给定一个长度为n的整数数列,以及一个整数k,请用快速选择算法求出数列的第k小的数是多少。Input一行包含两个整数 n 和 k。第二行包含 n 个整数(所有整数均在1~10^9范围内),表示整数数列。1≤n≤100000,1≤k≤nOutput输出一个整数,表示数列的第k小数。Sample Input 15 32 4 1 5 3Sample Output 13代码:#include<iostream&g原创 2021-08-19 01:01:30 · 172 阅读 · 0 评论 -
奶酪题解(洛谷P3958)
奶酪P3958 [NOIP2017 提高组] 奶酪题目描述现有一块大奶酪,它的高度为 h ,它的长度和宽度我们可以认为是无限大的,奶酪中间有许多半径相同的球形空洞。我们可以在这块奶酪中建立空间坐标系,在坐标系中,奶酪的下表面为 z = 0 ,奶酪的上表面为 z = h 。现在,奶酪的下表面有一只小老鼠 Jerry ,它知道奶酪中所有空洞的球心所在的坐标。如果两个空洞相切或是相交,则 Jerry 可以从其中一个空洞跑到另一个空洞,特别地,如果一个空洞与下表面相切或是相交, Jerry 则可以从奶酪下表原创 2021-08-18 17:06:42 · 493 阅读 · 0 评论 -
排序模板(记录)
冒泡排序#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int a[1001];int main(){ int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i];//从0开始 for(int i=0;i<n;i++){ for(int j=0;j<n-i-1;j++原创 2021-08-15 17:18:06 · 59 阅读 · 0 评论 -
逆序对数量
逆序对定义:对于给定的一段正整数序列,逆序对就是序列中 ai>aj, 且 i<j 的有序对求一列数有多少对逆序对例题:P1908 逆序对#include<iostream>#include<string.h>#include<algorithm>#include<math.h>using namespace std;const int N=500010;int n,a[N],tmp[N];long long ans=0;.原创 2021-08-14 20:44:15 · 259 阅读 · 0 评论 -
土地恢复(贪心)
土地恢复(贪心)宣文胜的家乡山西省是我国的产煤大省,因为长期挖煤导致了他家乡的某些地方出现了地陷的情况。近几年国家大力开展环境整治和土地复耕,让人民不仅享受经济发展所带来的红利更要还老百姓绿水青山。为了把这些地陷的土地恢复平整,他的家乡决定聘请他负责这项工作。他负责恢复的是一条长度为n的土地,恢复土地的主要工作是填平下陷的地表。需要恢复的土地可以看作是n块首尾相连的区域,一开始,第i块区域下陷的深度为di。宣文胜决定每天选择一段连续区间[M, N] ,填充这段区间中的每块区域,让其下陷深度减少1。在选原创 2021-08-10 18:17:01 · 66 阅读 · 0 评论 -
UCF Local Programming Contest Round 1A记录
A、 Briefcases Full of Money题目描述输入描述:输出描述:示例1输入84 111 2 3 2 3输出5示例2输入200 3 20 5 4 1输出50示例3输入1000 2 2 2 2 2输出1题意:有6个箱子,里面分别装1,5,10,20,50,100的钞票,给出每个箱子里会装多少张钞票,求那个箱子里的钱最多,如果有两个箱子的钱一样多,选择钞票数少的那个,因为重量轻。代码:#include<iostream>#i原创 2021-07-20 17:05:14 · 354 阅读 · 0 评论