acm
clhmw
这个作者很懒,什么都没留下…
展开
-
校赛——填充数字串
#include "stdio.h"#include "string.h"#include "windows.h"int partition( int * a, int * pos, int p, int r ){ int x = a[p]; int px = p; int i = p, j = r + 1; int temp; while ( 1 )原创 2010-05-17 22:23:00 · 648 阅读 · 0 评论 -
校赛——填充数字串——分析
填充数字串Problem Description小明最近对数字很感兴趣,整天对着数字发呆,今天想到一个奇妙的问题很兴奋,但百思不得其解,现在他向你寻求帮助。给定两个只包含数字[0..9]的数字串(不含前导0),求使用第二个数字串中的数字插入到第一个数字串中,使得插入后形成的第一个数字串中每两个相邻数字间的差值绝对值的和最大。注意:第二个数字串中的每个数字只能使用一次;不能插入到第一原创 2010-05-17 22:32:00 · 803 阅读 · 1 评论