随笔分类 -  OJ-其他学校

摘要:Given a integers x = 1, you have to apply Q (Q ≤ 100000) operations: Multiply, Divide. Input First line of the input file contains an integer T(0 incl 阅读全文
posted @ 2018-08-24 22:24 Roni_i 阅读(231) 评论(0) 推荐(0) 编辑
摘要:"题目链接" 所有元素初始值为0才能这么做: ①l r全加1 a[l]++; a[r+1] ; 求一遍前缀和为元素本身。 求两遍前缀和为元素前缀和。 include include include include include include include include include inc 阅读全文
posted @ 2018-08-24 01:19 Roni_i 阅读(131) 评论(0) 推荐(0) 编辑
摘要:Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to k 阅读全文
posted @ 2018-08-22 16:51 Roni_i 阅读(151) 评论(0) 推荐(0) 编辑
摘要:求给出第 K (0 2) 她的前几项如下: DP关键在于找到状态转移方程,而找方程关键在于找状态。我们从限制条件开始构造状态。以位数N和K构造是不现实的,数据量太多,我们可以位数为N的二进制数的个数作为状态,这样如果第i位填0则f[i] = f[i 1] 如果第i位填1则第i 1位只能填0,此时f[ 阅读全文
posted @ 2018-07-26 14:55 Roni_i 阅读(297) 评论(0) 推荐(0) 编辑
摘要:914 Yougth的最大化 内存限制:64MB 时间限制:1000ms 特判: No 通过数:3 提交数:4 难度:4 题目描述: Yougth现在有n个物品的重量和价值分别是Wi和Vi,你能帮他从中选出k个物品使得单位重量的价值最大吗? 输入描述: 有多组测试数据 每组测试数据第一行有两个数n和 阅读全文
posted @ 2018-07-24 14:15 Roni_i 阅读(336) 评论(0) 推荐(0) 编辑
摘要:``` #include using namespace std; const int N = 1e6,INF = 0x3f3f3f3f; int a[N]; int n,x; void fun(int n) { int left = 0, right = n-1; while(left x) { right--; } ... 阅读全文
posted @ 2018-07-02 12:42 Roni_i 阅读(353) 评论(0) 推荐(0) 编辑
摘要:0103 最短Hamilton路径 0x00「基本算法」例题 描述 给定一张 n(n≤20) 个点的带权无向图,点从 0~n 1 标号,求起点 0 到终点 n 1 的最短Hamilton路径。 Hamilton路径的定义是从 0 到 n 1 不重不漏地经过每个点恰好一次。 输入格式 第一行一个整数n 阅读全文
posted @ 2018-07-02 00:59 Roni_i 阅读(427) 评论(0) 推荐(1) 编辑
摘要:时间复杂度O(n) 有n个人,第i个人的重量为w[i],每艘船的最大载重量均为c,且最多只能乘两个人。用最少的船装载所有人。 思路:从最轻的开始考虑,让最轻的和最重的一条船,若超出重量则可判定最重的只能一人一条船 阅读全文
posted @ 2018-05-14 01:50 Roni_i 阅读(417) 评论(0) 推荐(0) 编辑
摘要:http://newoj.acmclub.cn/problems/1999 1999: 三角形or四边形? http://newoj.acmclub.cn/problems/1999 1999: 三角形or四边形? 描述 题目描述: JiangYu很无聊,所以他拿钉子在板子上戳出了一个由.#组成的1 阅读全文
posted @ 2018-05-12 17:52 Roni_i 阅读(1366) 评论(5) 推荐(1) 编辑
摘要:【链接】:https://cn.vjudge.net/problem/UVA-437 【题意】:给你n个立方体,让你以长宽为底,一个个搭起来(下面的立方体的长和宽必须大于上面的长和宽)求能得到的最长高,立方体能翻来覆去交换长宽高来用。 【代码】: 阅读全文
posted @ 2018-05-09 01:30 Roni_i 阅读(215) 评论(0) 推荐(0) 编辑
摘要:``` Secret agent Maria was sent to Algorithms City to carry out an especially dangerous mission. After several thrilling events we find her in the first station of Algorithms City Metro, examining the... 阅读全文
posted @ 2018-05-08 23:37 Roni_i 阅读(148) 评论(0) 推荐(0) 编辑
摘要:矩形嵌套 时间限制:3000 ms | 内存限制:65535 KB 难度:4 描述 有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a using namespace std; define N 1005 struct node { int x 阅读全文
posted @ 2018-05-08 19:18 Roni_i 阅读(305) 评论(0) 推荐(0) 编辑
摘要:题目描述 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭。由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹。 输入格式 输入数据为 阅读全文
posted @ 2018-05-07 21:08 Roni_i 阅读(165) 评论(0) 推荐(0) 编辑
摘要:include using namespace std; typedef long long ll; const double eps = 1e 7; const int maxn = 5e5 + 5; const double pi = acos( 1.0); char a[maxn]; int 阅读全文
posted @ 2018-05-06 00:45 Roni_i 阅读(292) 评论(0) 推荐(0) 编辑
摘要:``` Problem L: CreatorX背英语 Time Limit: 1 Sec Memory Limit: 64 MB Submit: 53 Solved: 36 [Submit][Status][Web Board] Description CreatorX最近在忙着背英语, Hzk i 阅读全文
posted @ 2018-05-05 22:39 Roni_i 阅读(190) 评论(0) 推荐(0) 编辑
摘要:include include using namespace std; const int MAXN = 2e5+10; int a[MAXN]; int main() { int n,x; long long ans=0; cin n; for(int i=0;i x;a[x]=i;} for( 阅读全文
posted @ 2018-05-05 22:18 Roni_i 阅读(405) 评论(0) 推荐(0) 编辑
摘要:【题意】:https://www.cnblogs.com/bluefly hrbust/p/8971769.html 本题题意就是把1到n数表示为,两组数之和相等,即能不能1 n划分成两部分(男女分组是干扰的) 1 2 3 4 5 6 7 8 偶数 1+8+2+7 = 3+6+4+5 1 2 3 4 阅读全文
posted @ 2018-04-29 21:20 Roni_i 阅读(262) 评论(0) 推荐(0) 编辑
摘要:Doki Doki Literature Club! is a visual novel developed by Team Salvato. The protagonist is invited by his childhood friend, Sayori, to join their high 阅读全文
posted @ 2018-04-29 14:58 Roni_i 阅读(586) 评论(0) 推荐(0) 编辑
摘要:King of Karaoke Time Limit: 1 Second Memory Limit: 65536 KB It's Karaoke time! DreamGrid is performing the song Powder Snow in the game King of Karaok 阅读全文
posted @ 2018-04-29 13:59 Roni_i 阅读(505) 评论(0) 推荐(0) 编辑
摘要:A sequence of $n$ integers $a_1, a_2, \dots, a_n$ is called a peak, if and only if there exists exactly one integer $k$ such that $1 a_i$ for all $k u 阅读全文
posted @ 2018-04-29 13:43 Roni_i 阅读(366) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示