- 博客(10)
- 资源 (5)
- 收藏
- 关注
原创 codeforces div518 D - Array Without Local Maximums - [dp]
题意:给定一个长度为 n(n≤1e5) 的数组 a[1:n],a[i] 的值域为 1 到 200,且每个数的旁边必须有一个不小于它的数。而有些数字被擦掉了,现在问共有多少种可行的填充方案。题解:看到这题第一感觉就dfs暴力搜索,然而时间复杂度显然不行,因此考虑dp。考虑 dp[i][x][0,1,2] 的表示的状态为已经确定了第 i 个数字为 x,而 0,1,2 分别表示第 i−1 个数 w...
2019-09-30 11:34:03 89
原创 codeforces_509_div2_D
按间隔长度尺取即可。没有相交段。#include<iostream> #include<cstdio>#include<cmath>#include<cstdlib>#include<cstring>#include<algorithm>using namespace std;int read(){ ...
2019-09-30 11:29:14 52
原创 Codeforces Round#509 Div.2 C
贪心,每次选择最后一次喝咖啡最早的一天,看是否能将此次喝咖啡加入这天,不行就新开一天。堆维护即可。#include<iostream> #include<cstdio>#include<cmath>#include<cstdlib>#include<cstring>#include<algorithm>#inc...
2019-09-30 11:27:25 63
原创 FCFS 的算法调度实现
1. FCFS 算法实现C++ 代码如下实现的方法: 模拟简单的数据结构代码功能:实现现有数据的CPU调度算法 #include <iostream>#include <string>#include <cstdio>#include <algorithm>#include <set>#include <vec...
2019-09-30 10:42:03 833
原创 RR 轮转算法CUP 调度
基于RR算法的CPU调度具体数据的实现#include<iostream>#include<algorithm>#include<queue>using namespace std;#define MAXSIZE 5int ID[MAXSIZE], COME_TIME[MAXSIZE], RUN_TIME[MAXSIZE];struct proc...
2019-09-30 10:38:52 359
原创 D. Cow and Snacks codeforces # 585 div2 小思维题
D. Cow and Snackstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe legendary Farmer John is throwing a huge party, and animals from all ove...
2019-09-20 19:29:24 330
原创 codeforces div2 #585 B. The Number of Products
B. The Number of Productstime limit per test2 secondsmemory limit per test256 megabytes inputstandard input outputstandard outputYou are given a sequence ????1,????2,…,???????? consisting of ???? non-zero intege...
2019-09-20 19:03:47 106
原创 CF C. Ancient Berland Circus
C. Ancient Berland Circustime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputNowadays all circuses in Berland have a round arena with diameter 13 ...
2019-09-17 21:09:03 231 1
原创 CF Theatre Square(注意强制类型转换)
Theatre Square in the capital city of Berland has a rectangular shape with the sizen×m meters. On the occasion of the city’s anniversary, a decision was taken to pave the Square with square granite f...
2019-09-17 21:06:28 150
ChineseNumberIdentify-master.zip
2020-06-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人