题目链接:点击打开链接
题意:
给定一个数n
找一个最大的数u使得u
枚举前面有多少位是一样的。然后分类讨论。啪啦啪啦
#include
#include
#include
#include
#include
using namespace std;
typedef long long ll;
const int N = 22;
int pie[N], piesize;
ll ...
分类:
其他好文 时间:
2014-09-07 19:52:35
阅读次数:
252
一开始觉得是数位DP,后来想不出来。 但是感觉爆搜+剪枝可以过,于是就过了。。#include #include #include using namespace std;typedef long long LL;const int maxn = 50;int lim[maxn], len;LL n...
分类:
其他好文 时间:
2014-09-07 18:32:55
阅读次数:
177
def funcname(param1,param2,...): statements在函数中没有与全局变量同名的变量时,我们可以直接读取全局变量的值(不提倡这么做,容易混淆)要想在函数内对全局变量进行重新赋值,就得在函数内使用global语句e.g.number = 23def assignnu....
分类:
编程语言 时间:
2014-09-07 12:19:05
阅读次数:
229
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers....
分类:
其他好文 时间:
2014-09-07 12:17:05
阅读次数:
160
if#!/usr/bin/pythonnumber=23guess=int(input('Enter an interger:')) #input返回的结果是string类型,需要用int()转化为int类型if guess == number: print('You guessed in.'...
分类:
编程语言 时间:
2014-09-07 11:01:14
阅读次数:
248
Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string b...
分类:
其他好文 时间:
2014-09-06 22:37:44
阅读次数:
208
Description
Problem H: Queuing at the doctors
Due to the increasing number of weird viruses spreading around, all the members of the International Confederation of Revolver Enthusiasts (ICORE) ar...
分类:
其他好文 时间:
2014-09-06 21:21:44
阅读次数:
369
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol...
分类:
其他好文 时间:
2014-09-06 21:18:33
阅读次数:
263
判断一个 int 是否为回文的有一点要注意的是:int x;int _x = abs(x);对 x 取绝对值的时候,会发生溢出。比如 x = INT_MIN 即 -2147483648 而 INT_MAX 为2147483647其实,负数不是回文数
分类:
其他好文 时间:
2014-09-06 21:08:53
阅读次数:
163
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
分类:
其他好文 时间:
2014-09-06 18:40:43
阅读次数:
224