摘要: 一开始TLE了。。。 1 /* 2 模拟 3 */ 4 #include 5 #include 6 const int maxn = 10005; 7 typedef __int64 int64; 8 int64 a[ maxn ]; 9 int main(){10 int64 k;11 int n,k1,k2 ;12 int T;13 scanf("%d",&T);14 int ca = 1;15 while( T-- ){16 scanf("%d%d%d%I64d",&n,&k1,&k2,&k);17 int6 阅读全文
posted @ 2013-07-11 22:21 xxx0624 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题意很简单。一次最多多切出一条边!其余的就没什么好说的了 1 import java.util.*; 2 import java.math.*; 3 public class Main{ 4 public static void main( String[] args ){ 5 Scanner cin = new Scanner( System.in ); 6 BigInteger n,m,p; 7 while( cin.hasNext() ){ 8 n = cin.nextBigInteger(); 9 ... 阅读全文
posted @ 2013-07-11 21:26 xxx0624 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 简单。 1 #include 2 #include 3 const int maxn = 1000006; 4 int a[ maxn ]; 5 int main(){ 6 int ca; 7 scanf("%d",&ca); 8 while( ca-- ){ 9 int n;10 scanf("%d",&n);11 for( int i=0;i=a[ i ] ){17 a[ i+1 ] -= a[ i ];18 a[ i ] = 0;19 ... 阅读全文
posted @ 2013-07-11 16:39 xxx0624 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题意:在一个序列中找出最长的某个序列。找出的序列满足题中的条件。关键:对于 第 i 个位置上的数,要知道与之相隔至少d的位置上的数的大小。可以利用线段树进行统计,查询。更新的时候利用dp的思想。 1 /* 2 统计某一段内有多少比aim小的数据 3 在更新的时候利用了dp的思想。 4 */ 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 const int maxn = 100005;11 struct node{12 int sum,l,r;13 }anode[ maxn1 )64 ... 阅读全文
posted @ 2013-07-11 16:20 xxx0624 阅读(577) 评论(0) 推荐(0) 编辑