2017年3月19日
摘要:
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
奚政
阅读(150)
推荐(0)
编辑
摘要:
小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更 阅读全文
posted @ 2017-03-19 04:43
奚政
阅读(188)
推荐(0)
编辑
摘要:
矩形面积并 线段树-扫描线裸题 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
奚政
阅读(166)
推荐(0)
编辑
摘要:
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
奚政
阅读(767)
推荐(0)
编辑
摘要:
给出修建边的边权,求连通所有点的最小花费 最小生成树裸题 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
奚政
阅读(131)
推荐(0)
编辑
摘要:
数列的单点修改、区间求和 树状数组或线段树入门题 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
奚政
阅读(161)
推荐(0)
编辑
摘要:
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
奚政
阅读(188)
推荐(0)
编辑
摘要:
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
奚政
阅读(213)
推荐(0)
编辑
摘要:
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
奚政
阅读(186)
推荐(0)
编辑
摘要:
将一个偶数拆成两个素数的和,欧拉筛暴力 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
奚政
阅读(182)
推荐(0)
编辑
摘要:
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
奚政
阅读(264)
推荐(0)
编辑
摘要:
数字中不能出现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
奚政
阅读(192)
推荐(0)
编辑
摘要:
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
奚政
阅读(256)
推荐(0)
编辑
摘要:
在字符串中不可重叠地寻找子串数量,暴力/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
奚政
阅读(374)
推荐(0)
编辑
摘要:
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
奚政
阅读(172)
推荐(0)
编辑
摘要:
数字三角形,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
奚政
阅读(105)
推荐(0)
编辑
摘要:
给出数轴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
奚政
阅读(286)
推荐(0)
编辑
摘要:
给出不同字母的权值,计算有多少种字母组合权值小于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
奚政
阅读(109)
推荐(0)
编辑
摘要:
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
奚政
阅读(182)
推荐(0)
编辑
摘要:
计算数的和的种类,母函数裸题 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
奚政
阅读(153)
推荐(0)
编辑
|
|
|