- 博客(80)
- 资源 (2)
- 收藏
- 关注
原创 python将GUI项目打包成exe文件
此项目分为两步:GUI编写程序pyinstaller打包软件所用到的第三方库:tkinterpyinstaller具体实现1. GUI界面本次主要讲解如何打包,所以在此只是设计一个十分简单GUI界面本次主要讲解如何打包,所以在此只是设计一个十分简单GUI界面代码如下from tkinter import Labelwidget=Label(None,text="Thi...
2018-09-24 02:10:48
25327
11
原创 python3爬虫技术路线
python3爬虫技术路线: python3——requests库 python3——beautifulSoup库 python3——re库 python3——WordCloud库(博主在爬取网易云音乐是制作了词云) python3——jieba库(中文分析) python3——matplotlib库(做数据分析) python3——json库(json文件处理) python3—...
2018-09-16 23:07:37
1723
原创 HDU 1004 Let the Balloon Rise (STL map)
HDU 1004 Let the Balloon Rise题解#include<iostream>#include<algorithm>#include<string>#include<math.h>#include<set>#includ
2018-09-02 10:34:51
213
原创 HDU1003 结题报告(最大子序列和)
HDU1003 Max Sum 题解#include<iostream>#include<algorithm>#include<string>#include<math.h>#include<set>#include<map&am
2018-09-02 10:02:00
434
原创 树莓派DHT11温湿度传感器+BMP280大气气压传感器
bmp:#ifndef _RASPI_BMP280_H_#define _RASPI_BMP280_H_#include <stdio.h>#include <wiringPi.h>#include <wiringPiI2C.h>unsigned short dig_t1,dig_p1;signed shor
2018-07-22 14:49:26
1969
原创 Codehorses T-shirts
#include<iostream>#include<map>#include<string>#include<cmath>using namespace std;string a, b;map<string, int> pre, cur;int ans =
2018-07-16 19:30:39
286
原创 H5通过百度地图API获取当前地理位置
首先去百度地图开饭平台注册key 博主亲测注册十分方便,不到3分钟就完成了。 完整代码如下: <!DOCTYPE html><html><head><meta charset="UTF-8"><script type="text/javascript" src="http://api.map.baidu.com/a
2018-06-24 23:02:46
14461
5
原创 Linux C编程(二)
1、父进程创建一个新的文本文件,并向文本文件中写入数据,当数据写入完成后,用匿名管道通信的方式将该文件传输给子进程,同时用命名管道文件将该文件传输给另一个进程#include&amp;amp;lt;unistd.h&amp;amp;gt;#include&amp;amp;lt;stdio.h&amp;amp;gt;#include&amp;amp;lt;stdlib.h&amp;amp;g
2018-06-09 16:59:03
889
原创 Linux C编程练习(一)
1、定制自己的ls命令#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;sys/types.h&amp;gt;#include &amp;lt;dirent.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;sys/types.h&am
2018-06-03 19:33:53
2943
原创 poj2387- Til the Cows Come Home
Til the Cows Come HomeDescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs he...
2018-05-28 01:01:54
197
原创 抓取淘宝商品信息并制作商品信息比价表(以口红为例)
快速抓取淘宝上口红信息就可以很好的为女友服务,帮女友挑选心怡的商品喽~~~ 反正小编是没有女朋友的(骄傲脸.jpg)import requestsimport reimport osdef getHtmlText(url): try: r=requests.get(url,timeout=30) r.raise_for_status() ...
2018-05-27 01:46:48
1642
原创 爬取网易云音乐榜单第一歌曲的热门评论并制作成词云
热歌榜第一——纸短情长import requestsfrom bs4 import BeautifulSoupimport jsonfrom wordcloud import WordCloudimport matplotlib.pyplot as pltimport jiebafrom os import pathfrom PIL import Imageimport num...
2018-05-27 01:31:38
1691
原创 线段树(模板题)
codevs1080 单点增加与区间询问#include&amp;lt;iostream&amp;gt;#include&amp;lt;string&amp;gt;#include&amp;lt;stdio.h&amp;gt;#include&amp;lt;math.h&amp;gt;using namespace std;typedef long
2018-05-23 00:14:50
956
原创 数列问题
原题网址https://www.nowcoder.com/acm/contest/122/H观察此题的数据10的18次方,一般情况下肯定会超时。结合之前做过的数列问题,无非就是找规律,多数情况下存在循环结。但是手动阀计算了几个数据后发现并不是那么简单。此题不是用循环结求解。于是用过程序打印出200个数据,规律仍没找到,但收获有一条:n出现第一次的位置为2的n次方减1。于是思路转向推导公式 f...
2018-05-20 13:06:35
686
原创 Linux进阶——基本命令操作学习【一】
Linux系统基本命令 Linux命令手册ls rm cp cat mvmkdir rmdir cd head tailecho date df du killchmod chown chgrp info man pwd ...
2018-05-19 21:19:45
293
原创 Linux进阶——基本命令操作学习【二】
Linux系统基本命令 Linux命令手册ls rm cp cat mvmkdir rmdir cd head tailecho date df du killchmod chown chgrp info man pwd ...
2018-05-19 21:19:29
473
原创 HDU1061——Rightmost Digit
Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which i...
2018-04-19 00:22:13
217
原创 HDU1406——完数
完数的定义:如果一个大于1的正整数的所有因子之和等于它的本身,则称这个数是完数,比如6,28都是完数:6=1+2+3;28=1+2+4+7+14。本题的任务是判断两个正整数之间完数的个数。INPUT 输入数据包含多行,第一行是一个正整数n,表示测试实例的个数,然后就是n个测试实例,每个实例占一行,由两个正整数num1和num2组成,(122 55 7Sample Output...
2018-04-18 22:08:21
486
原创 Uva10006——Carmichael Numbers
题意:我们把对任意的1<x<n都有x^n≡x(mod n)成立的合数(注意一定要是合数)n称为Carmichael Number.对于给定的整数n,判断它是不是Carmichael Number快速幂+素数判断(也可以素数打表)#include<iostream> #include<algorithm> #include<cmath...
2018-04-16 21:11:37
340
原创 Linux进阶之路——shell脚本解决系统管理常见问题
一、编写shell脚本,求1到100的和#!/bin/shsum=0i=1while test $i -le 100do sum=`expr $sum + $i` i=$(expr $i + 1)doneecho $sum二、编写shell脚本,从键盘输入两个数,求这两个数的和#!/bin/shread aread becho $(expr $...
2018-04-14 23:01:49
711
原创 东北农业大学春季赛校赛——wyh的数字(输出各位上数字)
链接:https://www.nowcoder.com/acm/contest/93/M 来源:牛客网输入描述: 输入第一行一个整数T(1&lt;=T&lt;=10) 接下来有T组测试数据,对于每组测试数据,输入一个整数n(1&lt;=n&lt;=10000000000) 输出描述: 对于每组测试数据,输出对应答案 示例1 输入 2 1234567 123456 输出 ...
2018-04-09 10:46:28
320
原创 PHP数据库(MySQL)——学习笔记(一)
连接数据库//面向对象<?php$servername = "localhost";$username = "username";$password = "password";// 创建连接$conn = new mysqli($servername, $username, $password);// 检测连接if ($conn->connect_error...
2018-04-06 01:01:38
251
原创 2018东北农业大学春季赛校赛——why的数字
链接:https://www.nowcoder.com/acm/contest/93/M 来源:牛客网题目描述 wyh学长十分钟爱数字‘7’,他想知道每一个数字中有多少个数字‘7’输入描述: 输入第一行一个整数T(1<=T<=10) 接下来有T组测试数据,对于每组测试数据,输入一个整数n(1<=n<=10000000000) 输出描述: 对于每组测试数...
2018-04-06 00:21:23
386
原创 2018年东北农业大学春季赛校赛——wyh的集合
链接:https://www.nowcoder.com/acm/contest/93/F 来源:牛客网题目描述 你们wyh学长给你n个点,让你分成2个集合,然后让你将这n个点进行两两连接在一起,连接规则是这样的连接的两个点必须在不同的两个集合一个集合内部任意两个点之间不能相连现在,wyh学长需要让你将这n个点任意分成2个集合之后,最多能连接多少条边?输入描述: 输入第...
2018-04-05 21:20:09
311
原创 2018年东北农业大学春季赛校赛——wyh的矩阵
链接:https://www.nowcoder.com/acm/contest/93/B 来源:牛客网给你一个n*n矩阵,按照顺序填入1到n*n的数,例如n=5,该矩阵如下1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 现在让你连接相邻两条边的中点,然后只保留他们...
2018-04-05 21:11:33
541
原创 n的阶乘末尾0的个数
链接:https://www.nowcoder.com/acm/contest/93/E 来源:牛客网题目描述 阶乘末尾有几个0?输入描述: 输入第一行一个整数T(1<=T<=100),代表测试组数 接下来T行,每行一个数n(1<=n<=10^9) 输出描述: 对于每组测试数据,输出对应答案 示例1 输入 5 1 2 3 4 5 输出...
2018-04-05 14:38:59
562
原创 迷宫游戏
链接:https://www.nowcoder.com/acm/contest/93/D 来源:牛客网题目描述 给你一个n*m的迷宫,这个迷宫中有以下几个标识:s代表起点t代表终点x代表障碍物.代表空地现在你们涵哥想知道能不能从起点走到终点不碰到障碍物(只能上下左右进行移动,并且不能移动到已经移动过的点)。输入描述: 输入第一行一个整数T(1<=T<...
2018-04-05 14:35:14
556
原创 POJ3126 Prime Path
DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is ...
2018-04-03 21:02:44
218
原创 python之单词词频统计
需求分析:指定任意英文文本,统计文本中个单词出现的频率,并选出出现频率最高的10个单词 环境:python 3.6.0 IDE:PyCharm 2017.2.3 module:string 数据类型:字符串,列表,元组,字典#!/usr/bin/python# -*- coding: UTF-8 -*-import stringimport matplotlib.pyplo
2018-01-19 21:52:14
2794
原创 A - Chtholly's request CodeForces - 897B
A - Chtholly’s request CodeForces - 897B — Thanks a lot for today. — I experienced so many great things.— You gave me memories like dreams… But I have to leave now…— One last request, can you…— Help m
2017-12-27 01:48:21
286
原创 小知识点之回文数(三种方法)
由于时间关系,再次先列出其中一种最为常见的判断回文数的方法。 之后会慢慢补上,并根据学习状况进行拓展~~(只要求对称的位置值相等就可以了)。#include<iostream>#include<string>#include<stdio.h>#include<math.h>using namespace std;string a;int main(){ int i,flag=
2017-12-27 01:02:40
618
原创 最大公约数和最小公倍数
公式:最大公约数*最小公倍数=两数之积 最大公约数三种方法:辗转相除,辗转相减法,穷举法。//辗转相除法#include<iostream>using namespace std;int main(){ int m,n,q; cin>>n>>m; while(n%m!=0){ q=n%m; n=m; m=q; }
2017-12-24 00:37:09
302
原创 B - Beautiful Divisors CodeForces - 893B
Recently Luba learned about a special kind of numbers that she calls beautiful numbers. The number is called beautiful iff its binary representation consists of k + 1 consecutive ones, and then k conse
2017-12-23 18:16:05
414
原创 m进制数转十进制数和十进制数转m进制数(m小于等于16)
m进制数转十进制数(乘权取余法)#include<iostream>#include<cmath>using namespace std;int main(){ int n,m; int ans=0; cin>>n>>m; for(int i=6;i>=0;i--){ int a=n/pow(10,i); //1式 int b
2017-12-21 17:36:43
2167
原创 CodeForces 893B Beautiful Divisors
C - Matrix Power Series Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak.Input The input contains exactly one test case. The first line of input contains three
2017-12-14 13:15:59
247
原创 快速幂算法详解
/*快速幂*/int pow(int a, int b) { int ans = 1, base = a; while (b != 0) { if (b & 1 != 0) ans *= base; base *= base; b >>= 1; } return ans;/*常规求
2017-12-01 00:04:55
798
原创 快速幂取余运算
题目描述 Description 输入b,p,k的值,编程计算bp mod k的值。其中的b,p,k*k为长整型数(2^31范围内)。输入描述 Input Description b p k 输出描述 Output Description 输出b^p mod k=?=左右没有空格样例输入 Sample Input 2 10 9样例输出 Sample Output ...
2017-11-30 23:23:27
1383
原创 B - Blocks
B - Blocks Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligentboy, he starts to think of a math problem of painting. Suppose there are N ...
2017-11-30 21:09:55
336
原创 敌兵布阵
Virtual Judge上的敌兵布阵工兵营地好比数组,这里要任意取一段工兵营地计算人数,很明显此题可以采用树状数组或线段树求解的。与上篇博客中树状数组不同,此题树状数组的实现采取结构体型,用c++中的类进行封装如下:本题中还有对树状数组元素的增减查询操作:数据更新:void Tree::updata(int x, int y) //对指定军营人...
2017-10-07 15:40:17
278
原创 codevs树状数组基础练习
题目描述一行N个方格,开始每个格子里都有一个整数。现在动态地提出一些问题和修改:提问的形式是求某一个特定的子区间[a,b]中所有元素的和;修改的规则是指定某一个格子x,加上或者减去一个特定的值A。现在要求你能对每个提问作出正确的回答。1≤N<100000,,提问和修改的总数m<10000条。 输入描述输入文件第一行为一个整数N,接下来是...
2017-10-07 14:16:40
376
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅