原创 敵兵佈陣||HDU1166

link:http://acm.hdu.edu.cn/showproblem.php?pid=1166 Problem Description C國的死對頭A國這段時間正在進行軍事演習,所以C國間諜頭子Derek和他手下Tidy

原创 A Simple Problem with Integers||POJ3468

link:http://poj.org/problem?id=3468 Description You have N integers, A1, A2, ... , AN. You need to deal with two k

原创 Asteroids||POJ3041

link:http://poj.org/problem?id=3041 Description Bessie wants to navigate her spaceship through a dangerous asteroi

原创 HDU2709||Sumsets

link:http://acm.hdu.edu.cn/showproblem.php?pid=2709 Farmer John commanded his cows to search for different sets

原创 Girls and Boys||HDU1068

link:http://acm.hdu.edu.cn/showproblem.php?pid=1068 Problem Description the second year of the university somebody

原创 過山車||HDU2063

link:http://acm.hdu.edu.cn/showproblem.php?pid=2063 Problem Description RPG girls今天和大家一起去遊樂場玩,終於可以坐上夢寐以求的過山車了。可是,過山

原创 z-sort

link:https://cn.vjudge.net/contest/190132#problem/I A student of z-school found a kind of sorting called z-sort. Th

原创 若有N個無序數字,設計算法查找其中第K大的數字,並估計算法的複雜度

可以用簡單選擇排序或者冒泡找出第k大的元素,當N很大時時間複雜度趨近於O(N) 也可以用堆排序選出來,時間複雜度O(K Log N) 最優解使用快排,時間複雜度O(N) 用快排劃分成兩個子集,且當前界限爲第x大,若 x > k ,

原创 51nod1305 Pairwise Sum and Divide

題目鏈接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1305 有這樣一段程序,fun會對整數數組A進行求值,其中Floor表示向下取整: fun(

原创 Period||POJ1961

link:http://poj.org/problem?id=1961 Description For each prefix of a given string S with N characters (each charac

原创 N皇后問題||HDU2553

題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=2553 Problem Description 在N*N的方格棋盤放置了N個皇后,使得它們不相互攻擊(即任意2個皇后不允許處在同一排

原创 完美字符串||51Nod1182

Link:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1182 約翰認爲字符串的完美度等於它裏面所有字母的完美度之和。每個字母的完美度可以由你來分配

原创 51nod 2020 排序相減

題目鏈接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=2020 “排序相減”操作是指對於任意一個四位數n,將四個數字分別進行順序排序和逆序排

原创 Color the ball||HDU1556

link:http://acm.hdu.edu.cn/showproblem.php?pid=1556 Problem Description N個氣球排成一排,從左到右依次編號爲1,2,3....N.每次給定2個整數a b(a

原创 'utf-8' codec can't decode byte 0xc4 in position 6442: invalid continuation

用python調用pandas庫打開csv文件時出現的 相應其他打開方式也可能會出現這種情況,一般是出現了字符集‘utf-8’解碼所打開文件內容時出現了無法解碼的字符,同理,有時候編碼也就是encode時也會出現無法編碼的字符 可