摘要: 1495. One-two, One-two 2Time limit: 2.0 second Memory limit: 64 MBA year ago the famous gangster Vito Maretti woke up in the morning and realized that he was bored of robbing banks of round sums. And for the last year he has been taking from banks sums that have only digits 1 and 2 in their decimal 阅读全文
posted @ 2013-08-15 19:34 persistent codeants 阅读(428) 评论(0) 推荐(0)
摘要: 1176. HyperchannelsTime limit: 1.0 second Memory limit: 64 MBThe Galaxy Empire consists of N planets. Hyperchannels exist between most of the planets. New Emperor urged to extend hyperchannels network in such a way, that he can move from any planet to any other using no more than one channel. One ca 阅读全文
posted @ 2013-08-15 17:11 persistent codeants 阅读(250) 评论(0) 推荐(0)
摘要: 1320. Graph DecompositionTime limit: 0.5 second Memory limit: 64 MBThere is a simple graph with an even number of edges. You are to define if it is possible to present it by the set of pairs of adjacent edges (having a common vertex).Inputcontains a sequence of the numbers pairs. Each pair denotes v 阅读全文
posted @ 2013-08-15 14:08 persistent codeants 阅读(343) 评论(0) 推荐(0)
摘要: 1651. Shortest SubchainTime limit: 1.0 second Memory limit: 64 MBA chainpis given in a directed graph without loops or multiple edges. It is required to specify its subchainqsuch thatthe initial and final vertices of the chainspandqcoincide;the edges in the chainqare in the same order as in the chai 阅读全文
posted @ 2013-08-15 10:01 persistent codeants 阅读(288) 评论(0) 推荐(0)
摘要: Give you N integers a1, a2 ... aN (|ai| 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 const int inf=-999999999;10 int a[1001];11 int sum[1001]={0};12 int dp1[1001];13 int dp2[1001];14 int n,i,j,k;15 int num;16 int main()17 {18 while(cin>>n&& 阅读全文
posted @ 2013-08-15 08:35 persistent codeants 阅读(254) 评论(0) 推荐(0)