Search found 277 matches

by UFP2161
Tue Jun 28, 2005 7:06 pm
Forum: Off topic (General chit-chat)
Topic: I win !! (the proper way!!!)
Replies: 2
Views: 2302

What if an admin comes in, posts, and then deletes your post? =)
by UFP2161
Sun Feb 06, 2005 6:06 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 25638

The scanf function requires the cstdio include.

Though, you should really never mix calls between scanf and cin (likewise for printf and cout).
by UFP2161
Thu Feb 03, 2005 5:56 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 180059

alloc.h is not part of the standard libraries.
by UFP2161
Sun Jan 02, 2005 2:08 am
Forum: C++
Topic: Compilation Error on C++ and Accepted on C
Replies: 1
Views: 1653

test.cpp: In function `int main()':
test.cpp:8: ANSI C++ forbids declaration `big' with no type
by UFP2161
Mon Dec 27, 2004 4:43 am
Forum: Volume 3 (300-399)
Topic: 331 - Mapping the Swaps
Replies: 11
Views: 5785

The first number is the number of elements.
by UFP2161
Sat Dec 25, 2004 10:41 pm
Forum: Volume 3 (300-399)
Topic: 314 - Robot
Replies: 30
Views: 6352

I got:

Code: Select all

12
5
3
7
-1
0
-1
4
20
11
-1
-1
-1
-1
-1
16
-1
-1
-1
-1
-1
10
-1
-1
19
-1
11
-1
-1
-1
-1
13
28
27
-1
-1
4
-1
-1
-1
-1
23
6
1
-1
-1
-1
27
-1
by UFP2161
Sat Dec 25, 2004 8:50 pm
Forum: Volume 104 (10400-10499)
Topic: 10426 - Knights' Nightmare
Replies: 17
Views: 7700

There's probably no input where a knight starts at the same position as another knight. Not explicitly stated, but does seem to be an additional constraint.

The PE is more likely due to 'set#1'. I think they can turn case-sensitivity on a per problem basis, but not entirely certain of that.
by UFP2161
Wed Dec 22, 2004 3:37 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 21989

naive O(N^6) is too slow.. though maybe if you memoize it some, it might be fast enough..
by UFP2161
Sun Dec 19, 2004 8:31 pm
Forum: Volume 106 (10600-10699)
Topic: 10633 - Rare Easy Problem
Replies: 37
Views: 18587

Yes, the input is fine with a long long. But some of the intermediate calculations probably went over 2^63-1.
by UFP2161
Sun Dec 19, 2004 5:04 am
Forum: Volume 106 (10600-10699)
Topic: 10633 - Rare Easy Problem
Replies: 37
Views: 18587

10^18 doesn't work.
by UFP2161
Sat Dec 18, 2004 4:42 am
Forum: Volume 106 (10600-10699)
Topic: 10633 - Rare Easy Problem
Replies: 37
Views: 18587

Floating point is inaccurate:
19 20
21
22
29 30
39 40
383
383
259 260
25
11111
1111111111111111111
11
88
99 100
7507507506
3803835948279 3803835948280
59169281361494714
517507628283924
6084072702
63072702753
999 1000
8764
6307
38641
2655
50766
63099 63100
by UFP2161
Fri Dec 17, 2004 2:12 am
Forum: C++
Topic: STL priority queue
Replies: 5
Views: 2887

[cpp]struct Foo { int key; int value; bool operator<(const Foo& foo) const { return key < foo.key; } }; priority_queue<Foo> myPriorityQueue;[/cpp] There are many other ones to do it, but usually it is just best to override the less than operator, which is the default for any ordered STL container.
by UFP2161
Tue Dec 14, 2004 2:23 am
Forum: C
Topic: Arrays with arbitrary offset in C
Replies: 8
Views: 3168

You can always #define a macro to do it.. [c]#define myarray(a,b) realarray[a+20][b+20];[/c] Of course, it would be less efficient since it's doing a+20 and then another addition on the pointer itself, and you'd hafta write code like myarray(-1, -2) instead of myarray[-1][-2]. At least you get rid o...
by UFP2161
Mon Dec 13, 2004 2:57 am
Forum: Volume 107 (10700-10799)
Topic: 10789 - Prime Frequency
Replies: 38
Views: 21163

What are the ASCII values of 0-9, A-Z, and a-z? That's your problem.
by UFP2161
Mon Dec 13, 2004 1:04 am
Forum: Volume 107 (10700-10799)
Topic: 10791 - Minimum Sum LCM
Replies: 46
Views: 22058

Why would the problem be different if multiset were used instead of set for N > 1?

Go to advanced search