Balloons(山东省第一届ACM省赛)】的更多相关文章

Shopping Time Limit: 1000MS Memory limit: 65536K 题目描述 Saya and Kudo go shopping together.You can assume the street as a straight line, while the shops are some points on the line.They park their car at the leftmost shop, visit all the shops from left…
Balloons Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Both Saya and Kudo like balloons. One day, they heard that in the central park, there will be thousands of people fly balloons to pattern a big image. They were very interested about…
  ID PID Title Accepted Submit A 2151 Phone Number 22 74 B 2159 Ivan comes again! 1 17 C 2158 Hello World! 18 70 D 2157 Greatest Number 2 27 E 2156 Fairy tale 0 0 F 2155 Emergency 2 26 G 2154 Shopping 23 42 H 2153 Clockwise 0 0 I 2152 Balloons 7 10 J…
Emergency Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Kudo’s real name is not Kudo. Her name is Kudryavka Anatolyevna Strugatskia, and Kudo is only her nickname.Now, she is facing an emergency in her hometown:Her mother is developing a…
题意 : 找联通块的个数,Saya定义两个相连是 |xa-xb| + |ya-yb| ≤ 1 ,但是Kudo定义的相连是 |xa-xb|≤1 并且 |ya-yb|≤1.输出按照两种方式数的联通块的各数. 思路 : 按照第一种定义方式就只能是上下左右四个位置,而第二种则是周围那8个都是相连的. #include <iostream> #include <stdio.h> #include <stdlib.h> #include <queue> #include…
休眠了2月了 要振作起来了!!... http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2155 因为点比较少 最多更新三百次 标记某个节点时直接更新与之相连的点的最短距离 #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdlib.…
题目大意: n个点,第i个点和第i+1个点可以构成向量,问最少删除多少个点可以让构成的向量顺时针旋转或者逆时针旋转. 分析: dp很好想,dp[j][i]表示以向量ji(第j个点到第i个点构成的向量)为终点的最大顺时针/逆时针向量数.状态转移方程为 dp[j][i] = max{dp[k][j]+1}. 问题个关键是如何判断2个向量是顺时针还是逆时针. 计算几何用的知识是求叉积和点积,叉积的作用是判断两个向量的左右(顺逆),点积的作用是判断两个向量的前后.举个例子,假设有2个向量v1,v2,‘*…
先看看上一个题: 题目大意是: 矩阵中有N个被标记的元素,然后针对每一个被标记的元素e(x,y),你要在所有被标记的元素中找到一个元素E(X,Y),使得X>x并且Y>y,如果存在多个满足条件的元素,先比较X,选择X最小的那个,如果还是有很多满足条件的元素,再比较Y,选择Y最小的元素,如果不存在就输出两个-1: 分析: 直接暴力就行了 这个题目大意: 这个题是上个题的坚强版,每次会增加或减少一个点,仍然找到一个元素E(X,Y),使得X>x并且Y>y: 最多有200000次操作,每次只…
Hello World! Time Limit: 1000MS Memory limit: 65536K 题目描述 We know that Ivan gives Saya three problems to solve (Problem F), and this is the first problem. "We need a programmer to help us for some projects. If you show us that you or one of your frie…
Phone Number Time Limit: 1000MS Memory limit: 65536K 题目描述 We know that if a phone number A is another phone number B's prefix, B is not able to be called. For an example, A is 123 while B is 12345, after pressing 123, we call A, and not able to call…