Description You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q. For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to th…
A. The Text Splitting 题目连接: http://www.codeforces.com/contest/612/problem/A Description You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q. For example, the string "Hello" for p = 2, q = 3…
//将n 分成k份的 分法总数 #include "stdafx.h" #include"stdio.h" #include<iostream> using namespace std; int f(int n,int k) { if (k == 2) return n / 2; else { int s = 0; for (int i = 1; i <= n / k; i++)//第一份初始值i s = s + f(n - (i - 1)*k -…
java.text.MessageFormat格式化字符串时的小技巧 public static void main(String[] args) throws InterruptedException { MessageFormat form = new MessageFormat( "{2,date,yyyy-MM-dd HH:mm:ss.SSS} The disk \"{1}\" contains {0,number,#.##} file(s).{3}");…