Search found 17 matches

by Piotrek Mazur
Fri Aug 13, 2004 10:39 pm
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 40628

Forgot about my post above - I had one little error. Now is AC :)
by Piotrek Mazur
Tue Aug 10, 2004 11:48 pm
Forum: Off topic (General chit-chat)
Topic: Roll Call: Operating System
Replies: 9
Views: 3841

Unfortunately, still on Windows. I had many problems with my old sound card on RedHat 9, I googled for solution but nothing works. If I won't be so lazy next month may be I will buy sth new an move to Linux ;)
by Piotrek Mazur
Tue Aug 10, 2004 11:43 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 22852

If I clearly understand you, this is finding the 'inversion number' (this algoritm works).
by Piotrek Mazur
Sat Aug 07, 2004 8:59 pm
Forum: Volume 4 (400-499)
Topic: 408 - Uniform Generator
Replies: 48
Views: 4116

Hmm... Try to change this lines: [c]/* ... */ while ( scanf ("%d%d%*c", &step, &mod) == 2 ) /* ... */ printf ("%10d%10d Good Choice\n\n", step, mod); else printf ("%10d%10d Bad Choice\n\n", step, mod); /* ... */[/c] 1) scanf - there is no need to read '%*c' <- this * is a bug? Any way you don't read...
by Piotrek Mazur
Sat Aug 07, 2004 8:41 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 50135

Do you include stdio.h?
by Piotrek Mazur
Wed Aug 04, 2004 10:15 pm
Forum: Volume 2 (200-299)
Topic: 264 - Count on Cantor
Replies: 47
Views: 13752

I count it this way: first I cut off as large number as I can - this is the sum of diagonals = 1+2+3+4+..... (i use sqrt, so my time is 0.006 too). Then I simply calculate the result.
by Piotrek Mazur
Sun Aug 01, 2004 9:50 pm
Forum: C++
Topic: strange compile error
Replies: 11
Views: 3606

I have gcc & g++ version 3.2.2 (Red Hat 9.0) - and when I compile this on gcc I have an error, on g++ - I have not.
I know it's strange, but it's true :-?
by Piotrek Mazur
Sun Aug 01, 2004 11:07 am
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 40628

I have tested judge's input of leading and trailing zeroes: and I think there are no test cases with it (but input like '0 0' can be).
by Piotrek Mazur
Sun Aug 01, 2004 10:34 am
Forum: C++
Topic: strange compile error
Replies: 11
Views: 3606

Krzysztof Duleba wrote:gcc and g++ means the same for C++ files. gcc is smart enough to switch to g++ in such case, so there should be no difference.
But there is a difference. Try to make this:

Code: Select all

g++ Test.cc
and you won't have any errors.
by Piotrek Mazur
Sat Jul 31, 2004 7:27 pm
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 40628

Can anyone give more sample input & output for this problem? I don't understand cleary when I have to replace zeros (leading zeros after adding, as the problem description says, and I tried to remove and not remove trailing zeros before adding).
by Piotrek Mazur
Sat Jul 31, 2004 9:40 am
Forum: Volume 105 (10500-10599)
Topic: 10550 - Combination Lock
Replies: 24
Views: 20815

Re: 10550 -- WA

You should write the code like this: [cpp]#include <iostream> using namespace std; /* code */ [/cpp] 1) there is no need to include stdio, if you use only cin and cout 2) declaration of iostream was wrong - but this cause only warning message And the major problem, you calculate the output in wrong ...
by Piotrek Mazur
Sat Jul 31, 2004 9:23 am
Forum: C++
Topic: strange compile error
Replies: 11
Views: 3606

You have to put this in your code after including libraries:
[cpp]using namespace std;
[/cpp]
by Piotrek Mazur
Thu Jul 29, 2004 10:45 pm
Forum: Volume 4 (400-499)
Topic: 483 - Word Scramble
Replies: 122
Views: 20135

Re: 483 WA

oulongbin wrote:char *a;
a=new char;
I think this case error: size of a is 1 char only.
by Piotrek Mazur
Thu Jul 29, 2004 10:27 pm
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 30926

Re: 495 HHHEEELLLPPPP!!!!

I wrote this code to solve the problem without strings. It works fine on my pc generating the correct output for all test cases as compared to the stringed program that got AC. However, the judge says WA. Can anyone help? Pretty please! :oops: Maybe your problem is in function main() - it has wrong...
by Piotrek Mazur
Tue Jul 27, 2004 10:37 pm
Forum: Volume 4 (400-499)
Topic: 483 - Word Scramble
Replies: 122
Views: 20135

I set this as input:
test
longtest
test
In output in third line was error - it looks like this:
tse'\0'tset

Go to advanced search