• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
奚政
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2017年3月19日

hdu1301 Jungle Roads 最小生成树
摘要: The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ag 阅读全文
posted @ 2017-03-19 04:47 奚政 阅读(157) 评论(0) 推荐(0)
 
hdu1281 棋盘游戏 二分图最大匹配
摘要: 小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更 阅读全文
posted @ 2017-03-19 04:43 奚政 阅读(194) 评论(0) 推荐(0)
 
hdu1255 覆盖的面积 线段树-扫描线
摘要: 矩形面积并 线段树-扫描线裸题 1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 #include<math.h> 5 using namespace std; 6 const int maxm=2e3+5; 7 con 阅读全文
posted @ 2017-03-19 04:39 奚政 阅读(174) 评论(0) 推荐(0)
 
hdu1238 Substrings 扩展KMP
摘要: You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found 阅读全文
posted @ 2017-03-19 04:37 奚政 阅读(773) 评论(0) 推荐(0)
 
hdu1233 还是畅通工程 最小生成树
摘要: 给出修建边的边权,求连通所有点的最小花费 最小生成树裸题 1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 using namespace std; 5 6 struct seg{ 7 int a,b,l; 8 bool 阅读全文
posted @ 2017-03-19 04:34 奚政 阅读(141) 评论(0) 推荐(0)
 
hdu1166 敌兵布阵 树状数组/线段树
摘要: 数列的单点修改、区间求和 树状数组或线段树入门题 1 #include<stdio.h> 2 #include<string.h> 3 4 int c[50005],N; 5 6 void add(int x,int a){ 7 while(x<=N){ 8 c[x]+=a; 9 x+=(x&-x) 阅读全文
posted @ 2017-03-19 04:30 奚政 阅读(172) 评论(0) 推荐(0)
 
hdu1097
摘要: hdu1097 求a^b的末位数 打表O(1) 1 import java.util.*; 2 3 public class Main { 4 static int [][]a = new int[15][15]; 5 static int []num = new int[15]; 6 public 阅读全文
posted @ 2017-03-19 04:26 奚政 阅读(198) 评论(0) 推荐(0)
 
hdu1029
摘要: hdu1029 找出数列中出现(N+1)/2次的数,暴力模拟 1 #include<stdio.h> 2 #include<map> 3 using namespace std; 4 5 int main(){ 6 int n; 7 while(scanf("%d",&n)!=EOF){ 8 map 阅读全文
posted @ 2017-03-19 04:22 奚政 阅读(224) 评论(0) 推荐(0)
 
hdu2099
摘要: hdu2099 模拟 1 #include<stdio.h> 2 int m[100]; 3 int main(){ 4 long long a,b,t; 5 while(scanf("%I64d%I64d",&a,&b)!=EOF&&(a!=0&&b!=0)){ 6 t=a*100; 7 long 阅读全文
posted @ 2017-03-19 04:18 奚政 阅读(193) 评论(0) 推荐(0)
 
hdu2098 分拆素数和 素数筛
摘要: 将一个偶数拆成两个素数的和,欧拉筛暴力 1 #include<stdio.h> 2 #include<string.h> 3 #define N 10001 4 int prime[10001]; 5 bool check[10001]; 6 int n,i,ans,tot=0,j; 7 8 voi 阅读全文
posted @ 2017-03-19 04:17 奚政 阅读(191) 评论(0) 推荐(0)
 
hdu2090-2097
摘要: hdu2090 模拟 1 #include<stdio.h> 2 int main(){ 3 char b[100]; 4 double price=0,a1,a2; 5 int i=0; 6 while(scanf("%s%lf%lf",b,&a1,&a2)!=EOF){ 7 price+=a1* 阅读全文
posted @ 2017-03-19 04:16 奚政 阅读(271) 评论(0) 推荐(0)
 
hdu2089 不要62 数位DP
摘要: 数字中不能出现4或者连续的62,数位DP裸题 1 #include<stdio.h> 2 #include<string.h> 3 long long ans; 4 bool a[1000000]; 5 void fun(){ 6 for(long long i=0;i<=1000000;i++){ 阅读全文
posted @ 2017-03-19 04:08 奚政 阅读(200) 评论(0) 推荐(0)
 
hdu2088
摘要: hdu2088 1 #include<stdio.h> 2 #include<algorithm> 3 using namespace std; 4 int h[55]; 5 int main(){ 6 int N,t=0; 7 while(scanf("%d",&N)!=EOF&&N!=0){ 8 阅读全文
posted @ 2017-03-19 04:06 奚政 阅读(269) 评论(0) 推荐(0)
 
hdu2087 剪花布条 暴力/KMP
摘要: 在字符串中不可重叠地寻找子串数量,暴力/KMP 1 #include<stdio.h> 2 #include<string.h> 3 4 int main(){ 5 char a[1005],b[1005]; 6 while(scanf("%s",a)!=EOF&&a[0]!='#'){ 7 sca 阅读全文
posted @ 2017-03-19 04:05 奚政 阅读(387) 评论(0) 推荐(0)
 
hdu2085-2086
摘要: hdu2085 模拟 1 #include<stdio.h> 2 long long a[35][2]; 3 void fun(){ 4 a[0][0]=1; 5 a[0][1]=0; 6 for(int i=1;i<=33;i++){ 7 a[i][0]=3*a[i-1][0]+2*a[i-1][ 阅读全文
posted @ 2017-03-19 04:03 奚政 阅读(183) 评论(0) 推荐(0)
 
hdu2084 数塔 DP
摘要: 数字三角形,DP裸题 1 #include<stdio.h> 2 #include<string.h> 3 #define max(a,b) (a)>(b)?a:b 4 5 int g[101][101],dp[101][101]; 6 7 int max1(int i,int j){ 8 retu 阅读全文
posted @ 2017-03-19 04:01 奚政 阅读(111) 评论(0) 推荐(0)
 
hdu2083 简易版之最短距离 排序水题
摘要: 给出数轴n个坐标,求一个点到所有点距离总和最小。排序后最中间一个点或两个点之间就是最优 1 #include<stdio.h> 2 #include<algorithm> 3 using namespace std; 4 int x[502]; 5 6 int main(){ 7 int M; 8 阅读全文
posted @ 2017-03-19 03:59 奚政 阅读(305) 评论(0) 推荐(0)
 
hdu2082 找单词 母函数
摘要: 给出不同字母的权值,计算有多少种字母组合权值小于50,母函数裸题 1 #include<stdio.h> 2 #include<string.h> 3 4 long long c1[51],c2[51]; 5 6 int main(){ 7 int N; 8 while(scanf("%d",&N) 阅读全文
posted @ 2017-03-19 03:56 奚政 阅读(116) 评论(0) 推荐(0)
 
hdu2080-2081
摘要: hdu2080 计算两点关于原点夹角,数学 1 #include<stdio.h> 2 #include<math.h> 3 double len(double x1,double y1,double x2,double y2){ 4 return sqrt((x1-x2)*(x1-x2)+(y1- 阅读全文
posted @ 2017-03-19 03:54 奚政 阅读(192) 评论(0) 推荐(0)
 
hdu2079 选课时间(题目已修改,注意读题) 母函数
摘要: 计算数的和的种类,母函数裸题 1 #include<stdio.h> 2 #include<string.h> 3 int c1[1000],c2[1000],a,b; 4 5 int main(){ 6 int T; 7 while(scanf("%d",&T)!=EOF){ 8 int n,k; 阅读全文
posted @ 2017-03-19 03:51 奚政 阅读(164) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3