自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

我在等那么一天的博客

一心一意是世界上最温柔的力量。

  • 博客(153)
  • 资源 (4)
  • 收藏
  • 关注

原创 [code] PTA 胡凡算法笔记 DAY015

文章目录题目 B1048 数字加密题目 A1005小结题目 B1048 数字加密题意按规则按位进行计算。思路首先是从后往前处理字符串,这里奇偶位的判断会变化。其次,需要注意字符串里面存的是字符在进行数学运算的时候需要减去·‘0’。再次,还需要注意的一点就是两个位数不一致的时候也需要按规则进行运算,不足的另一个需要补0。这里13进制我还是采用数组去存储。Code in C+...

2019-11-19 17:44:25 180

原创 [code] PTA 胡凡算法笔记 DAY014

文章目录题目 B1014 福尔摩斯的约会题目 B1024 科学计数法小结题目 B1014 福尔摩斯的约会题意DAY: 第一个相同的字母(范围A~G),按字母序表示MON ~ SUNHH:第二个相同的数字或字母(范围0-9 和A-N),按题意分别表示0-9 和10-23MM:第三个字符串和第四个字符串第一个相同的字母对应的下标值思路按题目给的转换规则分别进行转换,注意规定好范...

2019-11-18 20:48:21 137

原创 [code] PTA 胡凡算法笔记 DAY013

文章目录题目 B1021 个位数统计题目 B1031 查验身份证题目 B1021 个位数统计小结题目 B1021 个位数统计题意统计字符串中数字出现的次数,并按格式根据数字升序输出。思路设置数组,下标为数字,扫描字符串对应出现数字就加一,最后顺序扫描数组按格式输出非零数即可。Code in C++#include <cstdio>#define ma...

2019-11-17 20:22:08 173

原创 [code] PTA 胡凡算法笔记 DAY012

文章目录题意A1027 Colors in Mars题意A1058 A+B in Hogwarts题意B1006 换个格式输出整数小结题意A1027 Colors in Mars题意将输入的10进制RGB值转换为13进制,并按格式输出。思路解析题目本质就是一个进制转换的题目,因为十三进制超过10的部分会输出字母,所以这里需要设置一个数组作为映射,然后就是求R,G,B分别对应的十...

2019-11-16 19:53:32 195

原创 [code] PTA 胡凡算法笔记 DAY011

文章目录题目B1022 D进制的A+B题目B1037 在霍格沃茨找零钱题目A1011 D进制的A+B小结题目B1022 D进制的A+B题意将十进制A+B的结果转换为D进制的数输出。思路这里看A,B的范围知道int类型即可。然后在进制转换的时候需要倒着输出最后的结果,所以我这里算是偷懒用string类型存储最后的结果并且每求出一位采用头插法插入字符串。注意点:需要判断A+B...

2019-11-15 20:57:42 204

原创 [code] PTA 胡凡算法笔记 DAY010

文章目录题目B1036 跟奥巴马一起编程题目B1027 打印沙漏题目A1031 Hello World for U小结题目B1036 跟奥巴马一起编程题意根据给定边长和字符输出正方形,注意行数字符边长会大,只需要列数0.5倍,四舍五入取整即可。思路四舍五入我这里采用的判断是否有小数。这里还可以采用奇偶数来判断因为刚好是0.5倍。这里求出行数。之后就是控制输出问题。我这里采用的是...

2019-11-14 22:38:01 176

原创 [code] PTA 胡凡算法笔记 DAY009

文章目录题目 B1032 挖掘机技术哪家强题目 A1011 World Cup Betting题目 A1006 Sign In and Sign Out题目 A1036 Boys vs Girls小结题目 B1032 挖掘机技术哪家强题意计算输出总和最大的成绩信息。思路因为这里学校编号是连续的,所以可以考虑用数组下标和作为学校编号,然后在输入的时候边输入边计算,用一个变量去记录...

2019-11-13 19:52:40 173

原创 [code] PTA 胡凡算法笔记 DAY008

文章目录题目B1041 考试座位号题目 B1004 成绩排名题目 B1028 人口普查![在这里插入图片描述](https://img-blog.csdnimg.cn/20191112211254891.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4u...

2019-11-12 21:19:04 187

原创 [code] PTA胡凡算法笔记 DAY007

文章目录题目B1010 一元多项式求导题目A1009 Product of Polynomials小结题目B1010 一元多项式求导题意系数是指k.x^n,其中的k,指数值n,正常求导。思路因为是指数降序输入,这样不存在项的合并,所以可以边输入边处理,然后这里我通过first去控制输出格式,同时也可以作为计数来用,去控制是否输出0 0。Code in C++#inc...

2019-11-11 21:29:07 184

原创 [code] PTA 胡凡算法笔记 DAY006

文章目录题目 A1046题目 A1065小结题目 A1046题意简单的环,计算最小距离。这里要注意不要暴力超时。思路这里我开始的暴力方法导致超时了,然后看解析,这里的做法主要是先将结果计算出来,之后查询的时候o(1)就能计算出来。主要采用的是前缀和的方式。因为是个环所以距离不是取left-1 ~ right-1就是取另一半,所以这里把所有距离和sum计算出来了,然后dis数组中...

2019-11-10 20:48:20 216

原创 [code] PTA 胡凡算法笔记 DAY005

文章目录题目 B1018题目 A1042小结周五刷了一个小时结果只刷了一题多一点,时间也有点晚了,blog就没更新。然后周六继续周五没完成的,看了一下逻辑有点混乱没继续。题目 B1018题意拼音首字母代表石头剪刀布,然后输赢规则大家都懂。根据输入计算各自的输赢平局次数,最后输出各自赢得概率最高的字母。思路这里我很暴力地去判断输赢,最后最高概率字母因为按字母序来,所以从最...

2019-11-10 20:34:35 187

原创 [code] 胡凡算法笔记 DAY004

文章目录题目B1046B1008B1012小结题目B1046题意解读如题平局不计分,猜对对方记一分。思路就是简单的按规则来,平局不计分。猜对了给对方积一分。Code in C++#include <iostream>int main(){ int N; std::cin >> N; int a, an, b, ...

2019-11-07 23:56:59 703 2

原创 [code] PTA 胡凡算法笔记 DAY003

文章目录前言题目B1001 害死人不偿命的(3n+1猜想)B1002 写出这个数【误刷】B1011 A+B和CB1016 部分A+BB1026 程序运行时间前言之前为了准备PTA的考试有看一些攻略,别人推荐了胡凡的《算法笔记》,为了不无章法的乱刷题,现在开始按书中的顺序刷题。从第三章最简单的开始找找感觉,培养培养自信。题目B1001 害死人不偿命的(3n+1猜想)思路感觉这里就是...

2019-11-06 21:27:15 549

原创 [code] 1002 A+B for Polynomials DAY002

文章目录题目 甲级1002题意思路Code in C++小结知识点:数组的利用题目 甲级1002题意多项式A,B相加,输出格式需注意指数从大到小,以及空格控制。思路这里我开始项的有点多了,我还在想 ${2^2} + 4会不会计算,纠结了半天去看了别人的题解,发现不用,就是简单的对应指数相加。这里利用到了开数组,下标与指数对应的特性。因为指数最大是1000,所以这里我就申请了大小为100...

2019-11-05 20:32:50 228

原创 [code] PTA 1001 A+B Format DAY001

题目题意解读数据量int范围。求A+B的和,输出按三位逗号分隔格式输出。思路主要思路A+B数字的和转换为string类型再进行格式操作。思路1 从后向前输出,但是在处理的时候要注意整除的情况下不用再在前面加逗号的情况。eg. 100000 -> 100,000。我采用的是字符串的插入处理,看到网上还有其他人采用压栈的方式处理感觉也不错。思路2 从前往后处理。找到第一个加逗号...

2019-11-04 21:08:41 249

原创 [cuda] Linux系统多版本cuda环境下的cuda-9.0安装

文章目录前言环境安装验证cuda是否安装成功遇到的问题小结前言因为很多人共用一个账号在集群上跑代码,所以不免环境过于错杂,使得出错了也不知道怎么处理,所以这里记录一下重新安装cuda-9.0的过程。之前跑代码只要涉及到device部分的就会出错,当时还不知道为什么现在知道了,是因为驱动的问题。环境$&gt; uname -r3.10.0-514.el7.x86_64$&gt; ca...

2019-02-20 16:47:25 2967 1

原创 [日常刷题]leetcode+剑指offer D001

文章目录771.Jewels and Stones- Description- Solution in C++二位数组中的查找- 题目描述c++解题方案小结- 知识点771.Jewels and Stones- DescriptionYou’re given strings Jrepresenting the types of stones that are jewels, and S re...

2018-12-04 21:47:09 565

原创 [杂记]自觉与记录时间

核心概要自觉 = 自我察觉记录时间 = 显示化四维空间中的时间维度,让我们知道那时我们在做什么,以后我们该有怎样的期许去改变空间中的印记内容很久在看完柳比歇夫的转体《奇特的一生》后就开始了,自己的流水账式记录,主要记录,记录格式如下:开始时间-结束时间 所做事情(或草草几笔或做做笔记),唯一比较欠缺的就是对每周每个月的总结。现在在实验室来了,对于每月的总结算是有了,但是每周以及细节却被省去...

2018-11-02 08:25:08 313

原创 记参加2018CNCC大会的感悟

很激动,第一次参加这样的大会,并且地点在杭州,我一直想去的城市,而且此次大会举办的地点是在杭州国际博览中心,就是G20举办的地方。此次行程时间为10.24-10.28,大会举办时间为10.25-10.27,这次博文就主要分享一下自己的几个感悟吧。(来自渣渣内心的反思)感悟一大佬就是大佬,套用微微中的一句话,大脑这种东西还是在同一个境界才能互相承认的,不管是图灵奖的大佬还是美国院士还是很多我不记...

2018-10-28 22:20:17 976

原创 [日常刷题]leetcode D44

文章目录561. Array Partition I566. Reshape the Matrix小结561. Array Partition IGiven an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, ...

2018-10-23 23:41:58 278

原创 [日常刷题]leetcode D43

文章目录532. K-diff Pairs in an Array小结532. K-diff Pairs in an ArrayGiven an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is de...

2018-10-23 01:26:08 158

原创 [日常刷题]leetcode D42

文章目录521. Longest Uncommon Subsequence I551. Student Attendance Record I小结知识点521. Longest Uncommon Subsequence IGiven a group of two strings, you need to find the longest uncommon subsequence of this...

2018-10-22 00:52:31 259

原创 [日常刷题]leetcode D40 D41

文章目录479. Largest Palindrome Product504. Base 7506. Relative Ranks520. Detect Capital小结479. Largest Palindrome ProductFind the largest palindrome made from the product of two n-digit numbers.Since t...

2018-10-20 22:33:02 306

原创 [日常刷题]leetcode D39

文章目录492. Construct the Rectangle496. Next Greater Element I500. Keyboard Row小结492. Construct the RectangleFor a web developer, it is very important to know how to design a web page’s size. So, given...

2018-10-18 23:10:32 281

原创 [日常刷题]leetcode D38

文章目录482. License Key Formatting485. Max Consecutive Ones小结482. License Key FormattingYou are given a license key represented as a string S which consists only alphanumeric character and dashes. The ...

2018-10-18 00:24:42 206

原创 [日常刷题]leetcode D37

文章目录475. Heaters476. Number Complement小结知识点475. HeatersWinter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.Now, you are ...

2018-10-16 21:41:23 196

原创 [日常刷题]leetcode D36

文章目录458. Poor Pigs459. Repeated Substring Pattern461. Hamming Distance463. Island Perimeter小结知识点458. Poor PigsThere are 1000 buckets, one and only one of them contains poison, the rest are filled wi...

2018-10-16 00:48:24 303

原创 [日常刷题]leetcode D35

文章目录447. Number of Boomerangs453. Minimum Moves to Equal Array Elements455. Assign Cookies小结知识点447. Number of BoomerangsGiven n points in the plane that are all pairwise distinct, a “boomerang” is a...

2018-10-14 21:03:03 237

原创 [日常刷题]leetcode D34

文章目录441. Arranging Coins443. String Compression小结知识点441. Arranging CoinsYou have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.Given ...

2018-10-13 23:52:11 301

原创 [日常刷题]leetcode D33

文章目录414. Third Maximum Number415. Add Strings434. Number of Segments in a String438. Find All Anagrams in a String小结知识点414. Third Maximum NumberGiven a non-empty array of integers, return the third ...

2018-10-12 23:58:49 329

原创 [日常刷题]leetcode D32

文章目录409. Longest Palindrome412. Fizz Buzz小结知识点409. Longest PalindromeGiven a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built wit...

2018-10-12 01:15:38 180

原创 [日常刷题]leetcode D31

文章目录401. Binary Watch405. Convert a Number to Hexadecimal小结知识点401. Binary WatchA binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minut...

2018-10-10 20:32:40 345

原创 [日常刷题]leetcode D30

文章目录387. First Unique Character in a String389. Find the Difference400. Nth Digit小结知识点387. First Unique Character in a StringGiven a string, find the first non-repeating character in it and return i...

2018-10-09 21:46:18 295

原创 [日常刷题]leetcode D29

文章目录367. Valid Perfect Square371. Sum of Two Integers374. Guess Number Higher or Lower383. Ransom Note小结知识点367. Valid Perfect SquareGiven a positive integer num, write a function which returns True ...

2018-10-08 21:57:55 299

原创 [日常刷题]leetcode D28

文章目录344. Reverse String345. Reverse Vowels of a String349. Intersection of Two Arrays350. Intersection of Two Arrays II小结知识点344. Reverse StringWrite a function that takes a string as input and retur...

2018-10-08 14:17:12 306

原创 [日常刷题]leetcode D27

文章目录292. Nim Game303. Range Sum Query - Immutable326. Power of Three342. Power of Four小结知识点292. Nim GameYou are playing the following Nim Game with your friend: There is a heap of stones on the tabl...

2018-10-07 02:01:44 298

原创 [日常刷题]leetcode D26

文章目录268. Missing Number278. First Bad Version283. Move Zeroes290. Word Pattern小结知识点268. Missing NumberGiven an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is mi...

2018-10-05 23:41:48 243

原创 [日常刷题]leetcode D25

文章目录242. Valid Anagram258. Add Digits263. Ugly Number小结知识点242. Valid AnagramGiven two strings s and t , write a function to determine if t is an anagram of s.Example 1:Input: s = "anagram", t = "n...

2018-10-04 23:08:50 175

原创 [日常刷题]leetcode D24

文章目录232. Implement Queue using Stacks234. Palindrome Linked List237. Delete Node in a Linked List小结知识点232. Implement Queue using StacksImplement the following operations of a queue using stacks.pu...

2018-10-04 00:51:00 256

原创 [日常刷题]leetcode D23

文章目录118. Pascal's Triangle119. Pascal's Triangle II231. Power of Two小结知识点118. Pascal’s TriangleGiven a non-negative integer numRows, generate the first numRows of Pascal’s triangle.In Pascal’s tri...

2018-10-03 00:00:09 213

CSS学习示例

一个导航栏和网站的学习案例

2016-11-25

C语言中文帮助文档(内涵C++ primer)

内含:C++Primer4E、 C函数(index)、C函数速查、C语言编程宝典、C语言资料大全1.0、Tc图形函数详解

2016-02-05

JAVA 注册界面连数据库+集合排序

注册信息界面+连MySQL数据库,集合排序编程。

2016-01-04

JAVA Swing UI 学生信息+计算器

学生信息学号,籍贯级联,性别分组,计算器。

2016-01-04

空空如也

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

TA关注的人

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