Search found 430 matches

by misof
Sun Jan 07, 2007 1:31 pm
Forum: Off topic (General chit-chat)
Topic: I win !!
Replies: 361
Views: 122648

loghiyan was saying the truth. My post is lying.

Umm, wait, that's impossible, isn't it? If my post were indeed lying, then it is not true that loghiyan was saying the truth... and thus my post is not lying... but...

Anyway, I'm the winner now. And you are all too confused to post a reply :D
by misof
Fri Dec 22, 2006 12:06 am
Forum: Other words
Topic: New site: Resources for Informatics Olympiad
Replies: 4
Views: 4456

Consider contributing to http://www.algorithmist.com/ instead.

Also, you may want to find out what "copyright" means, not all e-books are legal and depending on where you live you may be committing a crime. Note the text at page four of the Concrete Maths ebook.
by misof
Mon Dec 18, 2006 2:43 pm
Forum: C++
Topic: A class with static member function. Compile error.
Replies: 2
Views: 1806

If you declare a member variable of a class as static, in C++, you must initialize it globally before using the static member variable. #include <iostream> using namespace std; class A { private: static int a; public: static void set(int i) { A::a = i; } static void get() { cout << A::a << endl; } }...
by misof
Mon Dec 18, 2006 11:41 am
Forum: Algorithms
Topic: Q-Matrix
Replies: 1
Views: 1411

Um, why don't you try searching this forum before asking?
by misof
Sun Dec 17, 2006 5:42 pm
Forum: Bugs and suggestions
Topic: 10200 Prime Time
Replies: 6
Views: 2362

can you just... printf("%.2f\n",100.0 * good / all+1.e-10); I'd say there is no possible input which produces a 4999999999 rounding situation; thus, using +EPS should work out. Anyway, I've slightly modified the description and added that sample to judge's output. What I don't want to add is that "...
by misof
Sun Dec 17, 2006 12:34 pm
Forum: Bugs and suggestions
Topic: 10200 Prime Time
Replies: 6
Views: 2362

Whenever one uses floating point operations, he should always think about the potential precision errors they may get, shouldn't he? Just think about all those problems unsolvable by float but solvable by double. I think that there's a difference between "you use floats instead of doubles, get a pr...
by misof
Sat Dec 16, 2006 8:55 pm
Forum: Bugs and suggestions
Topic: 10200 Prime Time
Replies: 6
Views: 2362

10200 Prime Time

The problem statement causes notorious problems with rounding the output. As making a special corrector costs time, I suggest the following change instead: After: For each pair a,b read, you must output the percentage of prime numbers produced by the formula in this interval (a <= n <= b) rounded to...
by misof
Tue Dec 12, 2006 12:37 pm
Forum: Bugs and suggestions
Topic: 358 Don't Have A Cow, Dude
Replies: 5
Views: 2579

358 Don't Have A Cow, Dude

The problem statement is ambiguous on output formatting. Moreover, the problem redefines the value of PI. The outcome is that people who use correct equations other than the author did get WA because they make precision errors on other places than the author did. (E.g., once you call sin(), you are ...
by misof
Mon Dec 11, 2006 7:24 pm
Forum: Bugs and suggestions
Topic: link to problem statement in stats
Replies: 8
Views: 2353

link to problem statement in stats

In stats pages like this one: http://acm.uva.es/problemset/usersnew.php?user=7600 I would like to have links pointing directly to the problem statements. IMHO, the problem number (or even better, its number+name) should link to the problem statement. Move the "problem stats" link to the "rank" colum...
by misof
Mon Dec 11, 2006 4:09 pm
Forum: Algorithms
Topic: swaping items algo problem
Replies: 5
Views: 2135

Darko: I'm guessing that the missing part of the problem statement is "minimize the number of swaps".
by misof
Mon Dec 11, 2006 3:41 pm
Forum: Algorithms
Topic: swaping items algo problem
Replies: 5
Views: 2135

"The objects in the collection have to be sorted in order given in the array of integers" The array mentioned above is a permutation. Find its cycles. How does one swap operation change how the cycles look like? How can it change their count? What is the final state you want to achieve, in terms of...
by misof
Mon Dec 11, 2006 3:36 pm
Forum: Algorithms
Topic: USACO All latin squares
Replies: 7
Views: 3449

Use the fact that the number of latin squares of the form

Code: Select all

1234567
2X
3
4
5
6
7
is equal for all X in {3,4,5,6,7}. I.e., instead of trying X from {1,3,4,5,6,7} here it is enough to try X=1 and X=3. This should bring your runtime under 1s.
by misof
Mon Dec 11, 2006 3:20 pm
Forum: Algorithms
Topic: Huffman CODE
Replies: 1
Views: 1662

by misof
Tue Dec 05, 2006 6:46 pm
Forum: C++
Topic: friend function from a namespace
Replies: 2
Views: 1602

I'm not sure whether this is what you wanted :D but the canonical way of avoiding including a file more than once is: // this is file wildcat.h #ifndef __wildcat_h #define __wildcat_h // ... original wildcat.h contents goes here #endif What this does: whenever you type #include "wildcat.h", the mean...
by misof
Fri Dec 01, 2006 10:52 pm
Forum: C++
Topic: Need a Help in Arrays
Replies: 4
Views: 1973

#include <cctype>
and then take a look at functions like: tolower(), isalpha(), ...

Go to advanced search