- 博客(354)
- 资源 (1)
- 收藏
- 关注
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 POJ刷题指南
POJ刷题指南好久没写代码,编码能力退步了,后期争取每日一题,能刷多少是多少。OJ上的一些水题(可用来练手和增加自信) (poj3299(√),poj2159(√),poj2739(√),poj1083(√),poj2262(√),poj1503(√),poj3006(√),poj2255(√),poj3094(√))好吧,这9道题的确挺水的,不过对于我们这种业余选手还是可以练
2017-12-06 20:17:31
5715
原创 LWC 109: 933.Number of Recent Calls
LWC 109: 933.Number of Recent Calls传送门:933.Number of Recent CallsProblem:Write a class RecentCounter to count recent requests.It has only one method: ping(int t), where t represents some time in...
2018-11-06 13:45:31
819
原创 POJ 刷题系列:1837. Balance
POJ 刷题系列:1837. Balance传送门:1837. Balance题意: 一个天枰上有C个钩子,把M个砝码挂在这些C个钩子上,问多少种平衡的挂法。思路: 首先考虑单个砝码在天枰的位置,可以得到C个状态,对应的平衡度为:G[0] * C[i],记录这些初始平衡度的个数。这样当放入第二个砝码时,可以遍历这些平衡度,从而得到一个新的平衡度。此时,不同位置,不同质量的砝...
2018-05-23 00:07:17
812
原创 2018 华为软件精英挑战赛 (上合赛区决赛:227/300分)
2018 华为软件精英挑战赛 (上合赛区决赛:227/300分)开源https://github.com/demonSong/HUAWEI-2018前言些许遗憾,没能进入上合赛区前四强,不过从中学习到的一些trick,以及比赛套路值得回味,当然还认识了许多赛区大佬,和他们交流的过程中,总能发掘一些新思路来弥补现有模型的不足。对于我们而言,这次比赛,我们被模型给限制住了思路,...
2018-04-30 21:48:01
3601
1
原创 2018“云移杯- 景区口碑评价分值预测
2018“云移杯- 景区口碑评价分值预测 (初赛第9) github链接:https://github.com/demonSong/DF_CCF_CONTEST前言实在太忙,找实习,天池,华为等比赛都放在一块了,该方案初赛第9,进入复赛之后就先放下了。此处记录从春节到3月份关于NLP的学习感悟,供大家参考。任务根据每个用户的评论,预测他们对景区的情感值(1~5)。...
2018-03-30 21:58:29
2336
2
原创 LWC 74: 793. Preimage Size of Factorial Zeroes Function
LWC 74: 793. Preimage Size of Factorial Zeroes Function传送门:793. Preimage Size of Factorial Zeroes FunctionProblem: Let f(x) be the number of zeroes at the end of x!. (Recall that x! = 1 * 2 * ...
2018-03-06 14:50:04
588
原创 LWC 74: 795. Number of Subarrays with Bounded Maximum
LWC 74: 795. Number of Subarrays with Bounded Maximum传送门:795. Number of Subarrays with Bounded MaximumProblem: We are given an array A of positive integers, and two positive integers L and R (...
2018-03-06 14:02:54
527
原创 LWC 74: 792. Number of Matching Subsequences
LWC 74: 792. Number of Matching Subsequences传送门:792. Number of Matching SubsequencesProblem: Given string S and a dictionary of words words, find the number of words[i] that is a subsequence o...
2018-03-06 10:33:13
1309
原创 LWC 74: 794. Valid Tic-Tac-Toe State
LWC 74: 794. Valid Tic-Tac-Toe State传送门:794. Valid Tic-Tac-Toe StateProblem: A Tic-Tac-Toe board is given as a string array board. Return True if and only if it is possible to reach this board...
2018-03-05 21:58:54
1246
原创 LWC 73: 790. Domino and Tromino Tiling
LWC 73: 790. Domino and Tromino Tiling传送门:790. Domino and Tromino TilingProblem: We have two types of tiles: a 2x1 domino shape, and an “L” tromino shape. These shapes may be rotated. XX ...
2018-02-26 10:08:54
965
2
原创 LWC 73: 791. Custom Sort String
LWC 73: 791. Custom Sort String传送门:791. Custom Sort StringProblem: S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom or...
2018-02-26 09:38:36
705
原创 LWC 73: 789. Escape The Ghosts
LWC 73: 789. Escape The Ghosts传送门:789. Escape The GhostsProblem: You are playing a simplified Pacman game. You start at the point (0, 0), and your destination is (target[0], target1). There ar...
2018-02-26 09:01:53
580
原创 LWC 73: 788. Rotated Digits
LWC 73: 788. Rotated Digits传送门:788. Rotated DigitsProblem: X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. A number...
2018-02-26 08:40:12
812
原创 LWC 72: 786. K-th Smallest Prime Fraction
LWC 72: 786. K-th Smallest Prime Fraction传送门:786. K-th Smallest Prime FractionProblem: A sorted list A contains 1, plus some number of primes. Then, for every p < q in the list, we conside...
2018-02-18 18:46:37
1046
原创 LWC 72: 787. Cheapest Flights Within K Stops
LWC 72: 787. Cheapest Flights Within K Stops传送门:787. Cheapest Flights Within K StopsProblem: There are n cities connected by m flights. Each fight starts from city u and arrives at v with a pr...
2018-02-18 18:06:44
1604
原创 LWC 72: 785. Is Graph Bipartite?
LWC 72: 785. Is Graph Bipartite?传送门:785. Is Graph Bipartite?Problem: Given a graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it’s set o...
2018-02-18 15:21:56
1039
原创 LWC 72: 784. Letter Case Permutation
LWC 72: 784. Letter Case Permutation传送门:784. Letter Case PermutationProblem: Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string....
2018-02-18 13:53:15
2181
原创 LWC 71: 782. Transform to Chessboard
LWC 71: 782. Transform to Chessboard传送门:782. Transform to ChessboardProblem: An N x N board contains only 0s and 1s. In each move, you can swap any 2 rows with each other, or any 2 columns wit...
2018-02-11 19:32:18
851
原创 LWC 71: 780. Reaching Points
LWC 71: 780. Reaching Points传送门:780. Reaching PointsProblem: A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). Given a starting point (sx, sy) a...
2018-02-11 18:05:07
579
原创 LWC 71: 781. Rabbits in Forest
LWC 71: 781. Rabbits in Forest传送门:781. Rabbits in ForestProblem: In a forest, each rabbit has some color. Some subset of rabbits (possibly all of them) tell you how many other rabbits have the...
2018-02-11 15:18:55
869
原创 LWC 71: 783. Minimum Distance Between BST Nodes
LWC 71: 783. Minimum Distance Between BST Nodes传送门:783. Minimum Distance Between BST NodesProblem: Given a Binary Search Tree (BST) with the root node root, return the minimum difference betwe...
2018-02-11 14:50:50
1027
原创 TensorFlow 入门(二):Softmax 识别手写数字
TensorFlow 入门(二):Softmax 识别手写数字@author: demonSong @email: daimeSong@gmail.comrefer to: http://www.tensorfly.cn/tfdoc/tutorials/mnist_beginners.htmlMNIST是一个非常简单的机器视觉数据集,如下图所示,它由几万张28像素x28像素的手写数字
2018-02-06 11:04:32
819
原创 TensorFlow 入门(一):基本使用
TensorFlow 入门(一):基本使用@author: demonSong @email: daimeSong@gmail.com基本使用refer to: http://wiki.jikexueyuan.com/project/tensorflow-zh/get_started/basic_usage.html 综述 TensorFlow 是一个编程系统, 使用图来
2018-02-05 21:57:31
3193
原创 POJ 刷题系列:3274. Gold Balanced Lineup
POJ 刷题系列:3274. Gold Balanced Lineup传送门:3274. Gold Balanced Lineup题意: 官方题解: Consider the partial sum sequence of each of the k features built by taking the sum of all the values up t
2018-02-04 22:04:21
402
原创 LWC 70: 778. Swim in Rising Water
LWC 70: 778. Swim in Rising Water传送门:778. Swim in Rising WaterProblem: On an N x N grid, each square grid[i][j] represents the elevation at that point (i,j). Now rain starts to fall. At t
2018-02-04 19:28:53
988
原创 LWC 70: 777. Swap Adjacent in LR String
LWC 70: 777. Swap Adjacent in LR String传送门:777. Swap Adjacent in LR StringProblem: In a string composed of ‘L’, ‘R’, and ‘X’ characters, like “RXXLRXRXL”, a move consists of either replacing o
2018-02-04 18:54:33
879
原创 LWC 70: 776. Split BST
LWC 70: 776. Split BST传送门:776. Split BSTProblem: Given a Binary Search Tree (BST) with root node root, and a target value V, split the tree into two subtrees where one subtree has nodes that a
2018-02-04 18:01:50
946
原创 LWC 70: 779. K-th Symbol in Grammar
LWC 70: 779. K-th Symbol in Grammar传送门:779. K-th Symbol in GrammarProblem: On the first row, we write a 0. Now in every subsequent row, we look at the previous row and replace each occurrence
2018-02-04 17:32:44
514
原创 POJ 刷题系列:2503. Babelfish
POJ 刷题系列:2503. Babelfish传送门:2503. Babelfish题意: 翻译:给出一英文单词和与之对应的外文,组成字典集。后续当给出一个外文单词时,求出对应的英文单词。思路: 无脑 HashMap,外文为key,英文单词为value,存入hashMap。代码如下:import java.io.IOException;import java
2018-02-04 10:27:00
370
原创 LWC 69: 774. Minimize Max Distance to Gas Station
LWC 69: 774. Minimize Max Distance to Gas Station传送门:774. Minimize Max Distance to Gas StationProblem: On a horizontal number line, we have gas stations at positions stations[0], stations1, …,
2018-01-29 14:36:25
2077
原创 LWC 69: 773. Sliding Puzzle
LWC 69: 773. Sliding Puzzle传送门:773. Sliding PuzzleProblem: On a 2x3 board, there are 5 tiles represented by the integers 1 through 5, and an empty square represented by 0. A move consists
2018-01-29 13:45:09
887
原创 LWC 69: 775. Global and Local Inversions
LWC 69: 775. Global and Local Inversions传送门:775. Global and Local InversionsProblem: We have some permutation A of [0, 1, …, N - 1], where N is the length of A. The number of (global) inv
2018-01-29 12:33:35
979
原创 LWC 69: 771. Jewels and Stones
LWC 69: 771. Jewels and Stones传送门:771. Jewels and StonesProblem: You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each characte
2018-01-29 11:09:31
1505
原创 LWC 68: 769. Max Chunks To Make Sorted (ver. 1)
LWC 68: 769. Max Chunks To Make Sorted (ver. 1)传送门:769. Max Chunks To Make Sorted (ver. 1)Problem: Given an array arr that is a permutation of [0, 1, …, arr.length - 1], we split the array int
2018-01-21 15:18:12
635
原创 LWC 68: 767. Reorganize String
LWC 68: 767. Reorganize String传送门:767. Reorganize StringProblem: Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the sam
2018-01-21 14:12:27
1051
原创 LWC 68: 766. Toeplitz Matrix
LWC 68: 766. Toeplitz Matrix传送门:766. Toeplitz MatrixProblem: A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, return T
2018-01-21 13:04:18
711
原创 POJ 刷题系列:2002. Squares
POJ 刷题系列:2002. Squares传送门:2002. Squares题意: 在二维坐标系下,给出若干点,求这些点最多能组成多少个正方形。思路: 可以观察输入n只有1000,所以我们可以把这些点全部存入内存中(hash),因为已知正方形的两个点,可以求出另两个点的坐标。这样暴力枚举每个点,判断是否存在构成正方形的两个点。代码如下:import java.
2018-01-19 20:15:42
384
原创 POJ 刷题系列:1840. Eqs
POJ 刷题系列:1840. Eqs传送门:1840. Eqs题意: 等式 a1x31+a2x32+a3x33+a4x34+a5x35=0a_1x_1^3+ a_2x_2^3+ a_3x_3^3+ a_4x_4^3+ a_5x_5^3=0 ,其中ai∈[−50,50],i=1,2,3,4,5a_i \in [-50, 50], i = 1, 2, 3, 4, 5,xi∈[−50,5
2018-01-17 19:31:05
310
原创 POJ 刷题系列:3349. Snowflake Snow Snowflakes
POJ 刷题系列:3349. Snowflake Snow Snowflakes传送门:3349. Snowflake Snow Snowflakes题意: 每个雪花都有六个分支,用六个整数代表,这六个整数是从任意一个分支开始,朝顺时针或逆时针方向遍历得到的。输入多个雪花,判断是否有形状一致的雪花存在。思路: 和HASH检测冲突的原理很像,先对6个数进行HASH而不管顺序,
2018-01-15 19:34:01
442
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人