- 博客(67)
- 收藏
- 关注
转载 git提交时忽略已提交过但本地已修改的文件
场景应该是这样的:有一个配置文件,比如是数据库的链接信息。每个人的链接信息是不一样的。但是又要提供一个标准的模板 用来告知如何填写链接信息,那么就存在git上需要记录一个标准配置文件,然后每个人根据自己的具体情况,配置一份链接信息自用。但是不会将该配置文件提交到库里。类似于SVN中的ignore on commit。具体操作如下:在命令行中输入git update-index --assume-unchanged [file-path]命令中的file-path 就是需要忽略提价的
2020-07-02 10:22:05 395
转载 如何删除GIT中的.DS_Store
.DS_Store 是什么使用 Mac 的用户可能会注意到,系统经常会自动在每个目录生成一个隐藏的 .DS_Store 文件。.DS_Store(英文全称 Desktop Services Store)是一种由苹果公司的Mac OS X操作系统所创造的隐藏文件,目的在于存贮目录的自定义属性,例如文件们的图标位置或者是背景色的选择。相当于 Windows 下的 desktop.ini。删除 .DS_Store如果你的项目中还没有自动生成的 .DS_Store 文件,那么直接将 .DS_Store
2020-06-28 10:26:17 786
转载 GIT 撤销本地修改
情景1:在本地分支写了半天,然后git commit 提交了,刚要准备push,才发现在master分支开发的,怎么办?git reset HEAD~ 或者 git reset HEAD~1这样 刚刚提交的就又回到本地的local changes 列表中。继续 切换分支,重新提交就可以了。如果你提交了多个commit,那么可以通过修改HEAD~之后的数字,来撤销前N次的commit。注:使用此命令,你原来提交的代码都在,不会被撤销情景2:如果你使用了多次git commit命令,但是发现刚
2020-06-28 10:16:05 175
转载 HttpServlet在不同类型时获取参数方式
获取参数的方式: 1、request.getParameter() 2、request.getInputStream() 3、request.getReader()一、当HttpServletRequest.getContentType = application/x- www-form-urlencoded(默认编码方式)时 编码后的结果通常是field1=value2&field2=value2&… 的形式,如 name=aaaa&password=bb...
2020-05-28 20:39:52 1000
原创 J - Java Beans
J - Java BeansTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit Status Practice ZOJ 3714DescriptionThere are N little kids sitting in a circle, eac
2014-03-01 15:53:15 544
原创 B - Break Standard Weight
DescriptionThe balance was the first mass measuring instrument invented. In its traditional form, it consists of a pivoted horizontal lever of equal length arms, called the beam, with a weighing p
2014-03-01 15:51:31 641
原创 N - Lake Counting
DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contai
2013-09-19 16:05:46 568
原创 L - Oil Deposits
DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a gri
2013-09-19 15:58:22 546
原创 F - Red and Black
DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent t
2013-09-19 15:19:49 764
原创 D - Throwing Dice
这题有空再看看Descriptionn common cubic dice are thrown. What is the probability that the sum of all thrown dice is at least x?InputInput starts with an integer T (≤ 200), denoting the
2013-08-30 16:58:31 440
转载 一些有用的数论公式
斯特灵公式是一条用来取n阶乘近似值的数学公式。一般来说,当n很大的时候,n阶乘的计算量十分大,所以斯特灵公式十分好用,而且,即使在n很小的时候,斯特灵公式的取值已经十分准确。公式为:以下等式或者不等式均可以用数学归纳法予以证明!1 + 3 + 5 + ... + (2n - 1) = n^21*2 + 2*3 + 3*4 + ... + n*(n + 1)
2013-08-28 20:40:48 588
原创 poj 1830 开关问题(guass)
这题用到了高斯消元法,有很多要注意的地方:a[i][j]表示第 j 个开关对第 i 个开关的影响,1表示有影响,0表示没有影响;对矩阵消元的时候我们用对角线上的元素去把这列其他不为0的元素消去, 如果遇到对角线上的这个元素为0,在这列找出不为0的和这行调换位置(swap);这里消元的时候取异或 ^ ,用1消的时候遇到1把它消成0,遇到0时变成1,最后我们要求出矩阵的秩 r ,自由未知量
2013-08-28 20:35:45 512
原创 A - Marbles
这题很好,不过我真的是想了很久,在别人的指点下,先用递归试了可以,但是太慢,再改成dp,交上去time limit ,题目所给的Tdp[2][5] = 2/7 * dp[1][4] + 5/7 * dp[2][3]dp[1][4] = 1/5 * dp[0][3] + 4/5 * dp[1][2]dp[2][3] = 2/5 * dp[1][2] +( 3/5 * dp[2
2013-08-28 11:00:05 535
原创 从给的一些数中任意选出几个数相乘(组合数),求出所有和
#include#includeint count,a[550],v,end;void dfs(int n,int y) //组合数 { int i; int sum=1; if(n==count) { for(int j=0;j<count;j++) printf(" %d ",a[j]); puts(""); for(int j=0;
2013-08-27 21:24:50 1037
原创 ligh oj 1004 - Monkey Banana Problem
You are in the world of mathematics to solve the great "Monkey Banana Problem". It states that, a monkey enters into a diamond shaped two dimensional array and can jump in any of the adjacent cells do
2013-08-25 13:51:51 552
原创 A - A Refining Company
这题经过提醒之后自己想了想,其实这个问题就是将矩形分成两部分,左下角的往左移,右上角的往上移,因为如果上一层的 i 个往左移,那么下面所有行的前 i 个只能往左移,往上移的路会被阻隔 ↑ ↑ ↑ ↑ ↑ ↑ ←←▕ ↑ ↑ ↑ ↑ ←←←▕ ↑ ↑ ↑←←←←▕ ↑↑ (▕ 表示分割线)DescriptionIts year 22
2013-08-25 11:13:54 564
原创 B - Agent 47
DescriptionAgent 47 is in a dangerous Mission "Black Monster Defeat - 15". It is a secret mission and so 47 has a limited supply of weapons. As a matter of fact he has only one weapon the old weak
2013-08-24 10:54:37 458
原创 A - Rooks
DescriptionA rook is a piece used in the game of chess which is played on a board of square grids. A rook can only move vertically or horizontally from its current position and two rooks attack ea
2013-08-23 17:08:45 533
原创 C - Race to 1 Again
DescriptionRimi learned a new thing about integers, which is - any positive integer greater than 1 can be divided by its divisors. So, he is now playing with this property. He selects a number N.
2013-08-23 15:01:38 630 1
原创 D - Palindrome Partitioning
这题我用了很笨的方法,可是经过一番努力我还是搞定了,很激动很激动DescriptionA palindrome partition is the partitioning of a string such that each separate substring is a palindrome.For example, the string "ABACABA"
2013-08-22 19:27:22 439
原创 A. Magic Numbers
A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514
2013-08-22 14:12:08 517
原创 Balanced Lineup
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows.
2013-08-21 14:39:29 419
原创 E - Neighbor House
DescriptionThe people of Mohammadpur have decided to paint each of their houses red, green, or blue. They've also decided that no two neighboring houses will be painted the same color. The neighbo
2013-08-20 16:53:01 462
原创 C - Easy Game
DescriptionYou are playing a two player game. Initially there are n integer numbers in an array and player A and B get chance to take them alternatively. Each player can take one or more numbers f
2013-08-20 16:16:13 567
原创 hdu 1230 I NEED A OFFER!
I NEED A OFFER!Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用
2013-08-20 14:41:45 427
原创 Charm Bracelet poj 01 背包
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each
2013-08-20 11:08:00 455
原创 D - Fast Bit Calculations
DescriptionA bit is a binary digit, taking a logical value of either 1 or 0 (also referred to as "true" or "false" respectively). And every decimal number has a binary representation which is actu
2013-08-18 19:57:56 494
原创 C - Love Calculator
DescriptionYes, you are developing a 'Love calculator'. The software would be quite complex such that nobody could crack the exact behavior of the software.So, given two names your software will
2013-08-18 14:39:50 552
原创 E - Generating Palindromes
DescriptionBy definition palindrome is a string which is not changed when reversed. "MADAM" is a nice example of palindrome. It is an easy job to test whether a given string is a palindrome or not
2013-08-18 13:42:27 586
原创 B - Discovering Gold
DescriptionYou are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn you th
2013-08-18 13:41:27 663
原创 A - A Dangerous Maze
DescriptionYou are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose the ith door
2013-08-18 13:40:18 669
原创 最长上升下降子序列
Description给定n个数,从中拿走x(x>=0)个数,使剩下的数最有下列性质。 A1 2 3 t > At+1 >At+2 > … > As 问最少要抽掉几个数,此数列才会具有以上性质。 Input一个数n (1Output输出最少要抽掉几个数,此数列才会具有以上性质。Sample Input3 1 2 36 1 2 6 5 4 8S
2013-08-16 12:21:16 475
原创 Super Jumping! Jumping! Jumping!
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to
2013-08-15 19:13:12 362
原创 Common Subsequence
Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there e
2013-08-15 16:01:44 410
原创 最大连续子序列 hdu 1231
Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ...,Nj },其中 1 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和 为20。 在今年的数据结构考卷中,要求编写程序得到最大和,现在增加一个要求,即还需
2013-08-15 15:24:33 347
原创 B - Marriage Ceremonies
DescriptionYou work in a company which organizes marriages. Marriages are not that easy to be made, so, the job is quite hard for you.The job gets more difficult when people come here and give t
2013-08-15 13:23:23 480
原创 免费馅饼
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中
2013-08-14 16:39:26 402
原创 数塔
Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1
2013-08-14 15:42:15 455
原创 枚举全排列
递归的使用,其中过程还要慢慢体会#include#includeint rec[20],num[20],n;int vis[20];void dfs(int dep){ //printf("s*******\n"); if(dep==n) { //printf("输出:"); for(int i=0;i<n;i++) printf("%d ",rec[i]);
2013-08-14 13:12:36 433
原创 深入浅出学算法034-最长公共子序列
深入浅出学算法034-最长公共子序列Time Limit:1000MS Memory Limit:65536KTotal Submit:260 Accepted:129Description一个给定序列的子序列是在该序列中删去若干项后所得到的序列。用数学语言表述,给定序列X={x1,x2,...xm},另一序列Z={z1,z2,...zk},X的子序列是指存在一个严格递增下标序列
2013-08-13 20:02:30 1209
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人