原创 Radar Installation(POJ-1328)
Description Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each s
原创 Weighted Median(山東省第五屆ACM大學生程序設計競賽 )
Problem Description For n elements x1, x2, ..., xn with positive integer weights w1, w2, ..., wn. The weighted median i
原创 Heavy Transportation(POJ-1797)
Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business.
原创 ACboy needs your help(HDU-1712)
Problem Description ACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit h
原创 快速冪( O(log n) )
快速冪模板,時間複雜度O(log n); #include<iostream> #include<cstdio> using namespace std; int pow_mod(int a,int n,int m)//快速冪,a爲底
原创 Power of Cryptography(POJ-2109 && UVA-113)
Description Current work in cryptography involves (among other things) large prime numbers and computing powers of numb
原创 2018年第九屆藍橋杯C++組B組第二題——明碼
標題:明碼漢字的字形存在於字庫中,即便在今天,16點陣的字庫也仍然使用廣泛。16點陣的字庫把每個漢字看成是16x16個像素信息。並把這些信息記錄在字節中。一個字節可以存儲8位信息,用32個字節就可以存一個漢字的字形了。把每個字節轉爲2進製
原创 Exponentiation(POJ-1001) Java大數例題
Description Problems involving the computation of exact values of very large magnitude and precision are common. For ex
原创 Coins (HDU-2844)
Problem Description Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened
原创 隊列——數據結構
鏈隊列和循環隊列及其應用——楊輝三角 #include<stdio.h> #include<stdlib.h> typedef struct Node //鏈隊列; { int data; struct Node
原创 KMP算法模板
KMP算法是一種改進的字符串匹配算法,又稱“看毛片”算法,時間複雜度爲O(m+n); 還不是很懂,但是代碼挺簡單的,先敲個模板,之後再細看; #include<iostream> #include<cstdio> #include<
原创 線性表——數據結構
線性表分順序儲存和鏈式儲存,鏈式儲存只寫了單鏈表、循環鏈表和雙向鏈表,及線性表的應用——一元多項式的表示及相加; 線性表的順序儲存及其操作: #include<stdio.h> #include<stdlib.h> #define
原创 Brackets Sequence (POJ-1141)
Description Let us define a regular brackets sequence in the following way: 1. Empty sequence is a regular sequence. 2.
原创 串——數據結構
數據結構 #include<stdio.h> #include<stdlib.h> #include<string.h> #define maxn 100 typedef struct //串; { char ch[max
原创 函數帶出方式示例——數據結構
之前爲了準備省賽,缺了好多課,現在真正慢慢補。。。。 ps:p29 #include<stdio.h> #include<stdlib.h> typedef struct //定義結構體; { int max,min;