[gcj] Re: in C++ how to format the output for int type

2009-09-05 Thread MagicLi
That is very good. Thanks a lot! I appreciate! On Sep 5, 4:14 am, krzych wrote: > IO manipulators are your friends (include iomanip): > > cout << "Case #" << i+1 << ": " << setfill('0') << setw(4) << res << > en

[gcj] in C++ how to format the output for int type

2009-09-04 Thread MagicLi
Like in qualification round for Problem C, we have to show instead of 0, I did it in a ugly way, change int to string type and then add '0' if num<1000, add '00' if num<100, add '000' if num<10; can anyone have a better way? BTW, do not use C-style output like fprintf(ofp, "Case #%d: %04d\n",

[gcj] Re: how is everyone going on the qualification round

2009-09-03 Thread MagicLi
gt; > >> Pablo > >> Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - > >> "Computers are useless. They can only give you answers." > > >> On Fri, Sep 4, 2009 at 6:55 AM, MagicLi wrote: > > >>> I fini

[gcj] how is everyone going on the qualification round

2009-09-03 Thread MagicLi
I finish problem A&B, for problem C, I finish the small input, my program fail the large input. I think there is better algorithm to work it out. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "google-codejam" group

[gcj] Re: Big integer in C++ problem

2009-09-03 Thread MagicLi
long long > - VC++ type: __int64 > >   If you simply want to reach 2^32-1 and don't need negative numbers > you may simply use the data type "unsigned long" which goes from 0 to > 2^32-1. > >   I hope it helps. > > João Alves > > On Sep 2, 4:36 pm, MagicLi

[gcj] Big integer in C++ problem

2009-09-02 Thread MagicLi
C++ in Windows, both int and long type are 4bytes, that means the biggest number can store is 2^31-1=2,147,483,647 , you may say the unsigned int could be larger, yes, but only twice lager, still under 10^10; for question like Round 1 B, B. Number Sets, the large input : 1 <= A <= B <= 10^12, 10

[gcj] join google code jam group

2009-08-28 Thread MagicLi
hi, I have joined google code jam 2009 contest. I'd like to talk to friends who are also interested in this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email