原创 POJ - 3660Cow Contest

N (1 ≤ N ≤ 100) cows, conveniently numbered 1.. N , are participating in a programming contest. As we all know, som

原创 迴文串最長

鏈接:https://www.nowcoder.com/questionTerminal/28c1dc06bc9b4afd957b01acdf046e69 來源:牛客網 給定一個字符串s,你可以從中刪除一些字符,使得剩下的串是一個迴文

原创 Python3字符串的問題

前言 python字符串中遇到的一些問題 目錄 str和bytes類型的轉換,encode與decode,以及字符串前的u,b,r 瀏覽器對含有中文的url進行轉換 判斷字符編碼 遇到b’\xe3\xea’或者u’\xe3\xe2’

原创 python3爬蟲 爬取mzitu.com圖片

網址:mzitu.com 功能:按名搜索,該名稱下所有圖集 很久之前寫的。最近下東西發現csdn的c幣已經沒了。。。只好不擇手段發這些來賺c幣了。。。 import urllib.request from urllib.parse i

原创 1

原创 爬取豆瓣電影所有類型的電影信息

import urllib.request from urllib.parse import quote import json import http.cookiejar import time import math import

原创 爬取MM131特定圖集

import urllib.request from lxml import etree import random import requests import time import re from fake_useragent

原创 POJ - 1751Highways最小生成樹kruskal

The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The

原创 POJ - 1258Agri-Net

#include <stdio.h> #include <string.h> #include <iostream> #include<algorithm> #include <vector> #include <queue> #incl

原创 必經點路徑問題疑惑

之前遇到過幾次求經過所有點的最短路徑問題。在網上也沒找到答案,大概有兩個問題。 求經過所有點的最短路徑,不可重複經過/可重複經過(兩點間不同方向權值不同)。 求必須經過特定點的最短路徑,後面同上。

原创 ZOJ - 1586QS Network prim

建圖邊值爲電纜得錢數加上兩邊電話的錢數,貼模板 #include <stdio.h> #include <string.h> #include <iostream> #include<algorithm> #include <vector

原创 POJ - 1251Jungle Roads prim()

只想靜靜的水題。prim #include <stdio.h> #include <string.h> #include <iostream> #include<algorithm> #include <vector> #include

原创 DUT數據結構第二章書後題

可以留言提意見…… 2.2順序表 #include<iostream> #include<vector> using namespace std; #define N 100 #define INF 0x3f3f3f3f int arr

原创 POJ - 3026Borg Maze

我好像是理解錯題意了。。。現在我想的是當人們找到達到一個目的點後纔可以分成多批人。 看了網上的一些代碼,但貌似都沒有解決一種情況,測試數據貌似也沒有這種情況。。。 空空A空空 在第一行時用gets,調試時發現這一行的A在第一個位置,這

原创 POJ - 2502Subway

You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to s