原创 POJ 1724 ROADS (優先隊列+最短路)

Description N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters assoc

原创 POJ 3414 Pots(模擬倒水)

Description You are given two pots, having the volume of A and B liters respectively. The following operations can

原创 POJ 3083 Children of the Candy Corn (BFS+DFS)

Description The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through

原创 POJ 3181 Dollar Dayz(劃分數詳解+高精度)

Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first

原创 HDU 3309 Roll The Cube

Problem Description This is a simple game.The goal of the game is to roll two balls to two holes each. 'B' -- ball '

原创 POJ 3280 Cheapest Palindrome

題目鏈接 Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has

原创 HDU 2159 FATE

Problem Description 最近xhd正在玩一款叫做FATE的遊戲,爲了得到極品裝備,xhd在不停的殺怪做任務。久而久之xhd開始對殺怪產生的厭惡感,但又不得不通過殺怪來升完這最後一級。現在的問題是,xhd升掉最後一級還

原创 HDU-3085 Nightmare Ⅱ (雙BFS)

Problem Description Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were

原创 POJ 1753 Flip Game

Description Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. O

原创 POJ 1190 生日蛋糕

7月17日是Mr.W的生日,ACM-THU爲此要製作一個體積爲Nπ的M層生日蛋糕,每層都是一個圓柱體。  設從下往上數第i(1 <= i <= M)層蛋糕是半徑爲Ri, 高度爲Hi的圓柱。當i < M時,要求Ri > Ri+1且Hi

原创 NYOJ 571 整數劃分(三)

描述 整數劃分是一個經典的問題。請寫一個程序,完成以下要求。   輸入每組輸入是兩個整數n和k。(1 <= n <= 50, 1 <= k <= n) 輸出對於輸入的 n,k; 第一行: 將n劃分成若干正整數之和的劃分數。

原创 UVA 3942 Remember the Word(Trie樹)

題目鏈接 題目大意:給出一個由s個不同的單詞組成的字典和一個長的字符串。把這個字符串分解成若干個單詞的連接(單詞可以重複使用),有多少種方法?比如,有4個單詞a, b, cd, ab,則abcd可以有兩種分解的方法:a+b+cd 和 ab

原创 PAT L2-001. 緊急救援(Dijkstra)

題目鏈接:https://www.patest.cn/contests/gplt/L2-001 作爲一個城市的應急救援隊伍的負責人,你有一張特殊的全國地圖。在地圖上顯示有多個分散的城市和一些連接城市的快速道路。每個城市的救援隊數量和每一條

原创 flask中的context(上下文)及其實現原理

原文鏈接:https://www.jianshu.com/p/7a7efbb7205f     上下文這個概念多見於文章中,是一句話中的語境,也就是語言環境。一句莫名其妙的話出現會讓人不理解什麼

原创 在ubuntu下安裝Python Moviepy模塊導入報錯

Moviepy是一個用來處理視頻的python第三方庫,基於ffmpeg實現的 因有些視頻需要處理下,因此就用到了這個Moviepy模塊,安裝沒有問題,但是導入的時候確報錯 from moviepy.editor import *