原创 poj1328Radar Installation--貪心

代碼如下: #include <cstdio> #include <iostream> #include <cstring> #include <cctype> #include <cmath> #include <algorithm>

原创 一些貪心算法題

1.獨木舟問題 代碼如下: #include <bits/stdc++.h> using namespace std; int a[10010]; int main() { int n, m; scanf( "%d%d", &n,

原创 2016鄭州大學ACM/ICPC訓練賽 Round5

A.小A能贏嗎? 題目大意:小A小B從一堆石頭裏拿石頭,每人每次拿1-3塊石頭,最後拿的人爲贏家,小A先拿。兩人都很聰明,給出石頭總數,判斷小A是否能贏,是輸出Yes,否輸出No 代碼如下: #include <cstdio> #in

原创 ZZU2016年五月實驗室招新賽

A.迴文串 代碼如下: #include <cstdio> #include <cstring> bool is_palin( char *s){ int x = strlen( s); for ( int i = 0; i < (

原创 zzuoj10436: easy problem

打個表即可 代碼如下; #include <cstdio> #include <iostream> #include <cstring> #include <cctype> #include <cmath> #include <algor

原创 zzulioj1873: This offer 深搜

題目鏈接 題目大意: 給出n個數,在這n個數兩兩之間加上加號或減號將其合併爲一個數,求最終不同的結果的個數 代碼如下: #include <bits/stdc++.h> using namespace std; int n, a[22],

原创 時間複雜度一定的算法1s內能處理的問題規模上限

當代計算機1s計算達百萬次 複雜度 數量級 最大規模 O(logN) >>10^20 很大 O(N^1/2) 10^12 10^14 O(N) 10^6 10^7 O(NlogN) 10^5 10^6 O(N

原创 hiho第六週--01揹包

原題鏈接 01揹包是在M件物品取出若干件放在空間爲W的揹包裏,每件物品的體積爲W1,W2……Wn,與之相對應的價值爲P1,P2……Pn,求揹包中物品的最大價值 狀態定義:d(i,j)爲到把前i個物品放在容量爲j的揹包能達到的最大value

原创 排序算法綜述

1.排序算法綜述 排序(sort)或分類                                            所謂排序,就是要整理文件中的記錄,使之按關鍵字遞增(或遞減)次序排列起來。其確切定義如下:     輸入:n

原创 nyistoj44--最大連續子串和

原題鏈接 代碼如下: #include <bits/stdc++.h> using namespace std; int main() { int t, n, sum, d, x; scanf( "%d", &t); while

原创 51nod--多重揹包

原題鏈接 代碼如下: #include <bits/stdc++.h> using namespace std; int d[50005]; int main() { int n, m, w, p, c; scanf( "%d%d

原创 2016鄭州大學ACM/ICPC訓練賽 Round4

B題:追蹤術 Description   賞金獵人在追捕他的獵物。已知當前賞金獵人與獵物相距s米,賞金獵人每秒移動a米,獵物每秒移動c米。賞金獵人有一個技能追蹤術,使用後,他的移動速度將會變爲每秒移動b米(b>a),使用該技能需要

原创 HNACM9熱身賽

A.一個關於電梯的題,類似去年省賽的最少換乘那題 B.表達式求值,第四屆省賽原題。之前看到過,但是當時沒做,兩個stack就可以了 C.雷達監控,就是判斷一個點到原點的距離。。。 題目及代碼稍後再補,明天正式賽,感覺今天手速有點慢了,晚上

原创 uestc水題CD Making

原題鏈接 題目大意: 把n首歌放到CD中,每個CD最多放k首歌,但是每個CD不能放13首,給出n和k求需要的CD數 代碼如下: #include <bits/stdc++.h> using namespace std; int main(

原创 poj1458Common Subsequence--LCS

原題鏈接 代碼如下: #include <cstdio> #include <iostream> #include <cstring> #include <cctype> #include <cmath> #include <algor