自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(342)
  • 收藏
  • 关注

原创 pytorch0.4.0版本如何加载torch0.4.1模型,看这里

0.4.1训练的模型会有 num_batches_tracked结尾的参数,事实上这些参数记录的信息 一般情况模型并不需要。0.4.0加载模型的时候 不会识别num_batches_tracked结尾的名字故需要将0.4.1的模型参数中num_batches_tracked结尾的参数删除例如价值0.4.1模型得到一个state_dictstate_dict = torch.load(mod...

2020-03-08 20:51:21 768

原创 NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the lat

NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.遇到这个问题解决办法:cd /usr/src 查看驱动版本号(我的是396.18)sudo apt-get ...

2020-01-02 16:08:38 278

原创 leetcode 142. Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Note: Do not modify the linked list.Follow up:Can you solve it without using extra space?题目要求不修改链表...

2018-07-16 19:42:56 1449 3

原创 [dp]Educational Codeforces Round 12 C. Simple Strings

题目zscoder loves simple strings! A string t is called simple if every pair of adjacent characters are distinct. For example ab, aba, zscoder are simple whereas aa, add are not simple.zscoder is giv...

2018-07-09 10:07:15 191 2

原创 KNN算法C++实现

KNN算法C++实现。C++11/* ***********************************************Author :guanjunCreated Time :2016/6/20 18:22:32File Name :1.cpp************************************************ */#inc

2016-06-20 20:15:00 1040 1

原创 控制台上画三角形圆和直线

基于C语言的。#include<stdio.h>#include<stdlib.h>#include<tchar.h>#include<windows.h>extern "C" WINBASEAPI HWND WINAPI GetConsoleWindow ();//把控制台的句柄给hwndint main(){ HWND hwnd; HDC hdc; HF

2016-06-07 08:45:13 1001

转载 苏格拉底与那个失恋的孩子

**苏格拉底:孩子,你为什么悲伤? 失恋者:我失恋了。 苏格拉底:哦,这很正常啊。如果失恋没有悲伤,恋爱大概也就没有什么味道。可是,年轻人,我怎么发现你对失恋头的投入比恋爱的投入还要倾心呢? 失恋者:到手的葡萄给丢了,这份遗憾,这份失落,您非当事人,怎知其中的酸楚啊。 苏格拉底:丢了就丢了,和不继续向前走呢,鲜美的葡萄有很多。 失恋者:等待,等到海枯石烂,知道她回心转意向我走来。 苏格拉

2016-05-10 09:16:12 652

原创 C++控制台时钟

c++控制台时钟。可以写几个头文件。这里没有写成头文件的形式。 c++11编译会出现点问题,建议用 vc6.0 。#include<iostream>#include<windows.h>#include<ctime>#include<cmath>#include<conio.h>#include<stdlib.h>using namespace std;# define PI 3.

2016-05-10 08:45:40 1554

原创 HDU 1754 线段树(单点更新)

线段树(intervaltree) 是把区间逐次二分得到的一树状结构,它反映了包括归并排序在内的很多分治算法的问题求解方式。http://acm.hdu.edu.cn/showproblem.php?pid=1754  为例:I Hate ItTime Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/O

2016-04-21 19:04:17 352

原创 数据结构-树状数组讲解

树状数组的作用:树状数组是对一个数组改变某个元素和求和比较实用的数据结构。其中”求和,更改“两部操做的时间复杂度都是O(log(n)),n为数组元素个数。在解题过程中,我们有时需要维护一个数组的前缀和S[i]=A[1]+A[2]+...+A[i]。但是不难发现,如果我们修改了任意一个A[i],S[i]、S[i+1]...S[n]都会发生变化。可以说,每次修改A[i]后,调整前缀和S[]在最坏情况下

2016-04-21 19:04:15 546

原创 KMP 算法模板

/*kmp 模板 2014年10月18日*/#includeusing namespace std;int f[100];void getFail(char* p, int* f)//预处理子串{ int m = strlen(p); f[0] = 0; f[1] = 0; for (int i = 1; i { int j = f[i]; while (j && p[i] != p[j])

2016-04-21 19:04:12 353

原创 POJ 2752 Seek the Name, Seek the Fame

http://poj.org/problem?id=2752这道题目的大意是:给你一个字符串,求他的前缀和后缀相等时的长度例如 字符串alala   :有 a=a ala=ala  alala=alala三种情况。答案是1 3 5  解题思路KMP的next数组。就如题目中的例子原串=ababcababababcabab,next=0 1 1 2 3 1 2 3 4 5 4 5 4 5 6 7 8

2016-04-21 19:04:10 289

原创 POJ 3461 Oulipo

http://poj.org/problem?id=3461题目大意是求子串在主串中出现的次数;#include#include#include#include#include#include#include#include#include#include#include#include #include #define maxn 10000+5#define ull unsigned long

2016-04-21 19:04:07 261

原创 LCA模板

#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ull unsigned long long#define ll long long#defin

2016-04-21 19:04:04 409

原创 HDU 2586 How far away ?(lca)

How far away ?Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8878    Accepted Submission(s): 3087Problem DescriptionThere are n houses in the v

2016-04-21 19:04:01 302

原创 HDU 4430 Yukari\'s Birthday

Yukari's BirthdayTime Limit: 12000/6000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3989    Accepted Submission(s): 911Problem DescriptionToday is Yukari's n-th b

2016-04-21 19:03:59 420

原创 快速幂

以前头脑里面根本没有快速幂的概念,今天算接触了快速幂;快速幂用来求m的n次方的,当 n很大时比如说n=1000000000,那么普通的O(n)求法会超时的(也不一定看出题人给的事件限制)。但有种做法是运用快速幂。可以把时间复杂度降到O(logn)。比如,我想求2^21那么 我可以通过求2,2^4,2^16求得。把21 分成1 4 16 。原理:以下以求a的b次方来介绍把b转换成二进制数。该二进制数

2016-04-21 19:03:56 317

原创 HDU 5360 Hiking

http://fengweiding.blog.163.com/HikingTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 431    Accepted Submission(s): 236Special JudgeProblem D

2016-04-21 19:03:53 306

原创 POJ 3273 Monthly Expense

http://fengweiding.blog.163.com/Monthly ExpenseTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 17708Accepted: 7072DescriptionFarmer John is an astounding accounting wizard and has realized he

2016-04-21 19:03:50 279

原创 POJ 2411 Mondriaan\'s Dream

adMondriaan's DreamTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 13211Accepted: 7700DescriptionSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after pr

2016-04-21 19:03:48 385

原创 POJ 1185 炮兵阵地

地址炮兵阵地Time Limit: 2000MSMemory Limit: 65536KTotal Submissions: 21629Accepted: 8400Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(

2016-04-21 19:03:45 283

原创 HDU 5339 Untitled

。。UntitledTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 301    Accepted Submission(s): 156Problem DescriptionThere is an integer a and n integ

2016-04-21 19:03:42 270

原创 POJ 3254 Corn Fields

Corn FieldsTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 9744Accepted: 5147DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) sq

2016-04-21 19:03:39 239

原创 HDU 5319 Painter

..PainterTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 886    Accepted Submission(s): 404Problem DescriptionMr. Hdu is an painter, as we all k

2016-04-21 19:03:36 314

原创 HDU 5328 Problem Killer

。。。。Problem KillerTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 252    Accepted Submission(s): 97Problem DescriptionYou are a "Problem Killer"

2016-04-21 19:03:33 258

原创 HDU 5326 Work

欢迎WorkTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 601    Accepted Submission(s): 401Problem DescriptionIt’s an interesting experience to mov

2016-04-21 19:03:31 231

原创 BestCoder Round #47 ($) HDU 5280 Senior\'s Array

http://acm.hdu.edu.cn/showproblem.php?pid=5280考少年——报考杭州电子科技大学计算机学院 Senior's ArrayTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 244    Accepted

2016-04-21 19:03:28 370

原创 Python 高亮设置(转)

初学Python,想必大家拿来练习最多的IDE就是Python自带的IDLE了,但是默认的代码配色及语法高亮主题确实很不适应,所以我们需要做个小小的美化,比如像下面这样我做的美化配置:HOW TO DO?别急,下面按我介绍的一步一步来就可以了,首先要找到名为config-highlight.cfg的文件,这个文件位于哪里呢?我列了一份可以找到它的路径清单:在Linux系列系统下路径为(~表示用户目

2016-04-21 19:03:25 2891

原创 A. Find Color

A. Find Colortime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNot so long ago as a result of combat operations the main Berland place of interest —

2016-04-21 19:03:22 337

原创 A. Towers

A. Towerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Vasya has received a young builder’s kit. The kit consists of several wooden bars,

2016-04-21 19:03:19 563

原创 A. Extra-terrestrial Intelligence

A. Extra-terrestrial Intelligencetime limit per test2 secondsmemory limit per test64 megabytesinputinput.txtoutputoutput.txtRecently Vasya got interested in finding extra-terrestrial intelligence. He

2016-04-21 19:03:16 526

原创 A. Shell Game

A. Shell Gametime limit per test2 secondsmemory limit per test64 megabytesinputinput.txtoutputoutput.txtToday the ?Z? city residents enjoy a shell game competition. The residents are gathered on the m

2016-04-21 19:03:14 405

原创 A. Reconnaissance 2

A. Reconnaissance 2time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputn soldiers stand in a circle. For each soldier his height ai is known. A reconn

2016-04-21 19:03:11 304

原创 A. What is for dinner?

A. What is for dinner?time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn one little known, but very beautiful country called Waterland, lives a lo

2016-04-21 19:03:08 588

原创 A. Reconnaissance

A. Reconnaissancetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAccording to the regulations of Berland's army, a reconnaissance unit should cons

2016-04-21 19:03:05 543

原创 A. Worms Evolution

A. Worms Evolutiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProfessor Vasechkin is studying evolution of worms. Recently he put forward hypo

2016-04-21 19:03:03 658

原创 A. Accounting

A. Accountingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA long time ago in some far country lived king Copa. After the recent king's reform,

2016-04-21 19:03:00 352

原创 A. Spit Problem

A. Spit Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn a Berland's zoo there is an enclosure with camels. It is known that camels like

2016-04-21 19:02:57 345

原创 A. Next Test

A. Next Testtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output?Polygon? is a system which allows to create programming tasks in a simple and profess

2016-04-21 19:02:54 869

原创 A. Almost Prime

A. Almost Primetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA number is called almost prime if it has exactly two distinct prime divisors. For

2016-04-21 19:02:52 478

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除