摘要:
又是水题,做个取余就行了sgu 404Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#include<stdio.h>2#include<stdlib.h>3#include<string.h>4intmain(... 阅读全文
posted @ 2010-02-15 20:56
DementRock
阅读(129)
评论(0)
推荐(0)
摘要:
这是一道构造题。设一个满足对应的N和K的串为S(N,K)。首先要理解题意,一次“rotate” 指,对于S0S2.....SN-1,向左rotate则变换为S2S3..SN-1S0。很显然,如果S(N,K mod N)已经求得,只需每个数加上[K/N]即可。现在,还有(K mod N)个数上要再加1,显然SN-1是其中一个。设经过若干次rotate之后,S(i+p) mod... 阅读全文
posted @ 2010-02-15 18:36
DementRock
阅读(447)
评论(0)
推荐(0)
摘要:
水题一道,分析好情况就行了(注意p<=0的情况)sgu276Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#include<stdio.h>2#include<stdlib.h>3intmain()4{5ints,p,... 阅读全文
posted @ 2010-02-15 18:23
DementRock
阅读(151)
评论(0)
推荐(0)
浙公网安备 33010602011771号