自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 南京理工大学第八届程序设计大赛 #C Count_Prime Solution

Description 给定你一个数n,请你统计出在[a,b]这个区间中和n互质的数的个数。 两个数互质当且仅当他们除了1之外没有其他的公共因子或者他们最大的公共因子是1。1和任何数是互素的。 Input 第一行输入一个整数T(1 <= T <= 100),表示T组测试数据。 接下来T行,每行3个整数a,b,n(1 <= a <=b <=10^15, 1<= n <= 10^9),用空

2016-04-19 10:46:51 278

原创 南京理工大学第八届程序设计大赛 #J WATER1 Solution

Description 听说全球气候变暖,冰川融化,海水淹大地。着实好奇要融化多少冰川会淹没我的宿舍,哦不,淹没南京,反正NJUST应该总会是第一批被淹的。 现将问题简化成一个二维坐标系的模型。有N个矩形块区域,每个区域有海拔(H)和宽度(W),区域按照顺序给出,比如有3个区域,第一个区域宽度为1,海拔为2,第二个区域宽度为5,海拔为6,第三个区域宽度为3,海拔为4,从图像上看就是像这

2016-04-19 10:38:23 381

原创 南京理工大学第八届程序设计大赛 #A 偷吃糖果 Solution

Description 小鱼喜欢吃糖果。他有两盒糖果,两盒糖果分别仅由小写字母组成的字符串s和字符串t构成。其中’a’到’z’表示具体的某种糖果类别。 他原本打算送给他喜欢的女生,但是要送给女孩子的话两盒糖果不能有差别(即字符串s和t完全相同)。所以,他决定偷吃几块,他吃糖果的策略是每次选出一盒糖果中两个连续的同种类别的糖果,然后吃掉其中一块。该策略可以使用多次。 例如一盒糖果是’

2016-04-19 10:13:54 405

原创 LeetCode #9 Palindrome Number C# Solution

Determine whether an integer is a palindrome. Do this without extra space. 题目只有很简单的一句话,然而提示又是一大堆 Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converti

2016-04-16 10:43:54 400

原创 LeetCode #8 String to Integer (ATOI) C# Solution

Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input c

2016-04-16 10:37:44 575

原创 LeetCode #7 Reverse Integer C# Solution

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 题目本身不难,主要是要注意很多情况。 Have you thought about this? Here are some good questions to ask before co

2016-04-16 10:28:59 322

原创 LeetCode #6 ZigZag Conversion C# Solution

The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) 可能有人不知道ZigZag是什么意思,其实就是给一个字符

2016-04-16 10:25:17 416

原创 LeetCode #5 Longest Palindromic Substring C# Solution

LeetCode #5 Problem Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 这题是

2016-04-15 09:00:47 362

原创 LeetCode #4 Median of Two Sorted Arrays C# Solution

LeetCode #4 Problem There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). 这道题应该是

2016-04-14 09:19:59 579

原创 LeetCode #3 Longest Substring Without Repeating Characters C# Solution

LeetCode #3 Problem Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which

2016-04-13 07:35:24 472

原创 LeetCode #2 Add Two Numbers Cpp Solution

LeetCode #2 Problem You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers a

2016-04-04 11:54:52 425

原创 LeetCode #1 Two Sum C# Solution

LeetCode #1 Problem Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. Ex

2016-04-03 14:00:12 1248

空空如也

空空如也

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

TA关注的人

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