It should be accepted within time limit with complexity O(n lg k) if the n = |h - l| that you mean.
BCOZ there are almost 1500 test cases and the worst case for each case : 1000*24.
Hence, it always pass the time limit successfully.
The complexity of my solution is O(n) where n = |h - l| which ...
Search found 23 matches
- Thu Jun 12, 2008 3:20 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11190 - Series of Powers
- Replies: 18
- Views: 13260
- Thu Jun 12, 2008 3:00 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11173 - Grey Codes
- Replies: 5
- Views: 6583
Re: 11173 - Grey Codes
You can solve this problem using some bitwise operation.
For more details:
Read the following book:
Art of Computer programming by Donald Knuth (Volume-4)
For more details:
Read the following book:
Art of Computer programming by Donald Knuth (Volume-4)
- Thu Jun 12, 2008 2:39 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11191 - Square
- Replies: 23
- Views: 15848
Re: 11191 - Perfect Square
I changed the following part of your code and get it accepted.
Your code:
int n,i,j,u,v;
long long m,zero;
I changed that part:
int i,j,u,v;
long long n, m,zero;
For your regards:
1. After accepted, you should remove your code from the post.
2. If you cofuse about the limit of number or ...
Your code:
int n,i,j,u,v;
long long m,zero;
I changed that part:
int i,j,u,v;
long long n, m,zero;
For your regards:
1. After accepted, you should remove your code from the post.
2. If you cofuse about the limit of number or ...
- Sat Dec 01, 2007 5:19 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11355 - Cool Points
- Replies: 8
- Views: 5328
- Sat Dec 01, 2007 11:27 am
- Forum: Volume 113 (11300-11399)
- Topic: 11355 - Cool Points
- Replies: 8
- Views: 5328
11355 - Cool Points
I got WA infinite times in this problem.
Can anybody help me who got ACC?
I post my code to verify why this got WA.
I assure that I will cut my code just see the accepted.
Thanks in advance.
Can anybody help me who got ACC?
I post my code to verify why this got WA.
Code: Select all
Cut After ACC
Thanks in advance.
- Sat Sep 29, 2007 10:23 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11291 - Smeech
- Replies: 8
- Views: 4273
11291 - Smeech
Can anyone explain what should do in this problem?
I cannot find the meaning of the following statement:
I cannot find the meaning of the following statement:
How can be p used for the statement?With probability p, (p e1 e2) represents x+y where x is the value of e1 and y is the value of e2; otherwise it represents x-y.
- Tue Sep 25, 2007 5:27 am
- Forum: Volume 112 (11200-11299)
- Topic: 11266 - Equations
- Replies: 15
- Views: 8280
- Sun Sep 23, 2007 11:16 am
- Forum: Volume 112 (11200-11299)
- Topic: 11266 - Equations
- Replies: 15
- Views: 8280
- Wed Sep 12, 2007 9:26 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11236 - Grocery store
- Replies: 9
- Views: 5850
- Wed Sep 12, 2007 7:43 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11260 - Odd Root Sum
- Replies: 22
- Views: 14083
- Wed Sep 12, 2007 5:03 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11260 - Odd Root Sum
- Replies: 22
- Views: 14083
- Wed Sep 12, 2007 4:36 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11261 - Bishops
- Replies: 13
- Views: 4888
- Tue Sep 11, 2007 9:29 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11260 - Odd Root Sum
- Replies: 22
- Views: 14083
- Tue Sep 11, 2007 5:14 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11254 - Consecutive Integers
- Replies: 24
- Views: 14569
Anyone who don't get ACC or idea to solve this problem:
Just read the following article:
Partitions into Consecutive Integers
http://www.mathpages.com/home/kmath107.htm
I think it will be helpful for solving the problem.
Just read the following article:
Partitions into Consecutive Integers
http://www.mathpages.com/home/kmath107.htm
I think it will be helpful for solving the problem.
- Tue Sep 11, 2007 5:04 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11260 - Odd Root Sum
- Replies: 22
- Views: 14083