1000: A+B Problem(1) Description Your task is to Calculate a + b. Your task is to Calculate a + b. Input The input will consist of a series of pairs o ...
分类:
其他好文 时间:
2016-04-03 22:09:17
阅读次数:
114
1. Description Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, ...
分类:
其他好文 时间:
2016-04-03 15:59:40
阅读次数:
189
Problem Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. ...
分类:
其他好文 时间:
2016-04-03 11:49:22
阅读次数:
173
Problem Description The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. Fo ...
分类:
其他好文 时间:
2016-03-29 23:58:46
阅读次数:
365
题意:给你若干个数对,给你一个序列,保证数对中的数都在序列中 对于这个序列,询问有多少个区间,不包含这些数对 分析:然后把这些数对转化成区间,然后对于这些区间排序,然后扫一遍,记录最靠右的左端点就好 这是一场cf edu 然后当时做的时候想都没想就树状数组了,SB了,其实不需要 #include<c ...
分类:
其他好文 时间:
2016-03-27 19:20:23
阅读次数:
158
ipairs 和pairs在lua中都是遍历tbale的函数但是两者有区别
1.pairs遍历table中的所有的key-vale 而ipairs会根据key的数值从1开始加1递增遍历对应的table[i]值...
分类:
其他好文 时间:
2016-03-27 01:53:11
阅读次数:
276
只要计算每个位置最多能到哪个位置,累加即可,DP从后往前预处理一下每个位置到达的最远位置。 有坑点:输入的时候如果同一个点出发的,需要保存最小值。 ...
分类:
其他好文 时间:
2016-03-26 12:27:21
阅读次数:
185
原题链接在这里:https://leetcode.com/problems/reconstruct-itinerary/ 题目: Given a list of airline tickets represented by pairs of departure and arrival airport
分类:
其他好文 时间:
2016-03-23 06:13:43
阅读次数:
136
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Given n = 3, a solution set is: "((()))", "(()
分类:
其他好文 时间:
2016-03-21 09:22:49
阅读次数:
188
题意 给你一个数n 求满足lcm(a, b) == n, a <= b 的 (a,b) 的个数 容易知道 n 是a, b的所有素因子取在a, b中较大指数的积 先将n分解为素数指数积的形式 n = π(pi^ei) 那么对于每个素因子pi pi在a,b中的指数ai, bi 至少有一个等于pi, 另一
分类:
其他好文 时间:
2016-03-19 20:59:18
阅读次数:
142