Jam's problem again Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 640 Accepted Submission(s): 210 Problem Description Jam like to solve the problem which on the 3D-axis,given N(1≤N≤100000)…
Weak Pair Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 1468 Accepted Submission(s): 472 Problem Description You are given a rooted tree of N nodes, labeled from 1 to N. To the ith node…
E. Hanoi Factory time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Of course you have heard the famous task about Hanoi Towers, but did you know that there is a special factory producing the…
C. Propagating tree Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/383/problem/C Description Iahub likes trees very much. Recently he discovered an interesting tree named propagating tree. The tree consists of n nodes numb…
题目链接:http://poj.org/problem?id=2299 求逆序数的经典题,求逆序数可用树状数组,归并排序,线段树求解,本文给出树状数组,归并排序,线段树的解法. 归并排序: #include<cstdio> #include<iostream> using namespace std; #define max 500002 int arr[max],b[max];//b[]为临时序列,arr[]为待排序数列,结果在arr[]中 int tp[max]; ;//总逆序…
Necklace Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2083 Accepted Submission(s): 747 Problem Description Mery has a beautiful necklace. The necklace is made up of N magic balls. Each ba…
Stars Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37323 Accepted: 16278 Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star b…
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud 2224: Boring Counting Time Limit: 3 Sec Memory Limit: 128 MB Description In this problem you are given a number sequence P consisting of N integer and Pi is the ith element in the sequence.…
Super Mario Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5560 Accepted Submission(s): 2532 Problem Description Mario is world-famous plumber. His “burly” figure and amazing jumping ability…
Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了.A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况.由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视. 中央情报局要研究敌人究竟演习什么战术,所以Tidy要随时向Derek汇报某一段连续的工兵营地一共有多少…
E. e-Government time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The best programmers of Embezzland compete to develop a part of the project called "e-Government" — the system of automa…