Search found 286 matches

by sumankar
Wed Mar 01, 2006 11:16 am
Forum: Algorithms
Topic: putchar
Replies: 3
Views: 1337

Re: putchar

...putchar(m % 10) ... or, ...putchar(m % 10 + '0') ... My turn: #include <stdio.h> int main() { int n; while ( 1 == scanf( "%d", &n) ) { int m = 0; if ( n < 0 ) putchar('-'), n *= -1; do { m = 10*m + n%10, n /= 10; } while (n); do { putchar(m % 10 + '0'), m /= 10; } while (m); putchar('\n'); } ret...
by sumankar
Tue Feb 21, 2006 4:30 pm
Forum: C++
Topic: swap
Replies: 2
Views: 1446

std::swap from <algorithm> might help, provided you've defined
[1] Copy ctor
[2] Assignment operator
for your struct.
by sumankar
Mon Feb 20, 2006 9:05 am
Forum: Other words
Topic: New ranklist format for each problem
Replies: 31
Views: 9833

Re: to administrators

Ferdous wrote:why are you, the administrators, are callous to the voice of us demanding the old format?
When you make a request, you ask very, very politely :wink:
You're probably ruining any chances of getting what you want.
by sumankar
Fri Feb 17, 2006 6:54 am
Forum: C++
Topic: Why is this so simple code compiled error?
Replies: 4
Views: 1814

Re: Why is this so simple code compiled error?

ImLazy wrote:

Code: Select all

#include <cmath>
should've been

Code: Select all

#include <cstdlib>
man for abs.
by sumankar
Thu Feb 16, 2006 7:56 am
Forum: Other words
Topic: source code of other members
Replies: 6
Views: 2695

That's a Real-Bad-Idea. You don't even want to know if the author wanted to part with their source code or not!
by sumankar
Thu Feb 16, 2006 7:51 am
Forum: Volume 5 (500-599)
Topic: 501 - Black Box
Replies: 35
Views: 16304

The thing you guys missed out was, even STL takes learning. It doesn't
happen *just-like-that*. So, I feel its a good thing that people are learning STL even if its only to make life (read UVA-hard problems) easy.
by sumankar
Tue Feb 14, 2006 10:13 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 52472

Re: 102 help me always "Compile error"

chiunyao wrote:

Code: Select all

for(int k=0;k<6;k++) 
That is not supported by the C language version judge's gcc takes in. Put the

Code: Select all

int k;
part somewhere at the top where you declare your variables and see if it works or not.
by sumankar
Tue Feb 14, 2006 10:04 am
Forum: Volume 109 (10900-10999)
Topic: 10991 - Region
Replies: 17
Views: 8766

Well you might call it a "discrepancy", ... as in discordance, disagreement; but I think if the problem statement has made that clear and you miss it, you have got no one to blame. 0. I was not blaming some[one|thing], but was musing aloud. 1. The problem statement body & sample i/o make one whole:...
by sumankar
Tue Feb 14, 2006 7:21 am
Forum: Volume 109 (10900-10999)
Topic: 10991 - Region
Replies: 17
Views: 8766

How come no one has ever bothered about the apparent discrepancy in the problem description? Prob desctiption:Output For each line of input, generate one line of output containing the area of G rounded to six decimal digits after the decimal point. Floating-point errors will be ignored by special ju...
by sumankar
Fri Feb 10, 2006 6:55 am
Forum: Volume 109 (10900-10999)
Topic: 10908 - Largest Square
Replies: 37
Views: 19907

Well my prog matches the o/p exactly. Thanks for your patience, but I guess I'll have to give
up on this one :(
by sumankar
Thu Feb 09, 2006 7:57 am
Forum: Volume 109 (10900-10999)
Topic: 10908 - Largest Square
Replies: 37
Views: 19907

Code: Select all

1 1 1
1
3 2 1
1
by sumankar
Tue Feb 07, 2006 10:48 am
Forum: Volume 109 (10900-10999)
Topic: 10908 - Largest Square
Replies: 37
Views: 19907

Code: Select all

7 10 4
1
1
5
1
1 1 1
0
by sumankar
Tue Feb 07, 2006 6:41 am
Forum: Volume 109 (10900-10999)
Topic: 10908 - Largest Square
Replies: 37
Views: 19907

Thanks mamun for your test case. But still getting correct answers at home, and a WA at uva!
by sumankar
Mon Feb 06, 2006 11:38 am
Forum: Volume 109 (10900-10999)
Topic: 10908 - Largest Square
Replies: 37
Views: 19907

I checked all available threads for this one. My code seems to give correct output for all of them.
Can I get some more test cases?

I would like to know as well if the input is well formed i.e. can there be spaces in between a particular row description?

Regards,
Suman.
by sumankar
Thu Jan 19, 2006 1:33 pm
Forum: C++
Topic: Is STL set a binary search tree?
Replies: 9
Views: 6205

Thanks. Another question, how can I get an element of index i in an STL set quickly (O(log n) time). .... Why would you want that? How do you want the index to be calculated ? I don't know where & why you are using that, but I'd suggest some other container, if its speed that you are getting tied u...

Go to advanced search