上一页 1 2 3 4 5 6 7 8 ··· 21 下一页
摘要: http://codeforces.com/problemset/problem/10/A题很简单,就是题意难懂啊。。。 1 #include 2 #include 3 #include 4 using namespace std; 5 const int N=102; 6 struct node 7 { 8 int l,r; 9 } g[N];10 int main()11 {12 int n,p1,p2,p3,t1,t2;13 while(cin>>n>>p1>>p2>>p3>>t1>>t2)14 {15 int su 阅读全文
posted @ 2014-04-10 00:21 N_ll 阅读(145) 评论(0) 推荐(0) 编辑
摘要: A. Train and Petertime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputPeter likes to travel by train. He likes it so much that on the train he falls asleep.Once in summer Peter was going by train from city A to city B, and as usual, was sleeping. Then 阅读全文
posted @ 2014-04-08 19:59 N_ll 阅读(314) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/problemset/problem/414/BB. Mashmokh and ACMtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM in 阅读全文
posted @ 2014-04-07 17:07 N_ll 阅读(365) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1005找循环节。。 1 #include 2 #include 3 const int N=52; 4 int f[N]; 5 int main() 6 { 7 int a,b,n; 8 while(~scanf("%d%d%d",&a,&b,&n)) 9 {10 int s,e;11 if (a==0&&b==0&&n==0)12 break;13 f[0] = 1;14 f[1] = 1;1... 阅读全文
posted @ 2014-04-04 20:17 N_ll 阅读(122) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2321题意:第一次用java写代码。。纪念一下。。虽然写的有点挫。。 1 import java.math.BigInteger; 2 import java.util.Scanner; 3 4 5 public class Main { 6 7 public static void main(String[] args) { 8 9 Scanner cin = new Scanner(Syste... 阅读全文
posted @ 2014-04-03 22:58 N_ll 阅读(261) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3792题意:给出n个小正方体的中心坐标,求构成的多重小立方体的表面积。要求输入的下一个小正方体必须与之前的正方体有一个面是相交的。如果不满足条件,输出NO,并输出第几个正方体是不满足条件的。思路:总面积s = n*6;每形成距离为1的正方体面积就减少2,如果在该正方体之前没有距离为1的正方体则该正方体不满足条件。注意重坐标。 1 #include 2 #include 3 #include 4 using namespace std; 5 const int N=1010; 6 struct node 7 { 8 int x,... 阅读全文
posted @ 2014-04-03 19:56 N_ll 阅读(248) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1126简单的线段树求区间最值 1 #include 2 #include 3 #include 4 using namespace std; 5 const int N=100002; 6 int a[N],ans ; 7 struct node 8 { 9 int l,r,Max;10 } tree[N*4];11 void build(int t,int l,int r)12 {13 tree[t].l = l;14 tree[t].r = r;15 if (l... 阅读全文
posted @ 2014-04-01 19:10 N_ll 阅读(195) 评论(0) 推荐(0) 编辑
摘要: B. Long Pathtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day, little Vasya found himself in a maze consisting of(n + 1)rooms, numbered from1to(n + 1). Initially, Vasya is at the first room and to get out of the maze, he needs to get to the( 阅读全文
posted @ 2014-03-31 14:42 N_ll 阅读(313) 评论(0) 推荐(1) 编辑
摘要: C. Triangletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a right triangle with legs of lengthaandb. Your task is to determine whether it is possible to locate the triangle on the plane in such a way that none of its sides is parallel to 阅读全文
posted @ 2014-03-31 14:21 N_ll 阅读(195) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1754简单线段树题,单点更新+区间求最大值。 1 #include 2 #include 3 #include 4 using namespace std; 5 const int N=200002; 6 int a[N],ans = 0; 7 struct node 8 { 9 int l,r;10 int Max;11 } tree[4*N];12 void build(int root,int l,int r)13 {14 tree[root].l = l;15 t... 阅读全文
posted @ 2014-03-31 14:02 N_ll 阅读(140) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 21 下一页