Could someone tell me the number of bits for the following variables (in the case of the online judge, obviously):
1.int (16 or 32)
2. long
3. long long
The reason I ask is that many problems say stuff like "input will be less than or equal to 32767" and in other cases "the result will fit into an integer" or "the result will be less than 2^31-1". In VC++ ints and longs are 32 bits. Is it the same with the online judge's compiler?
Any help is appreciated.
Variable(int) bits....
Moderator: Board moderators
-
- New poster
- Posts: 45
- Joined: Fri Jan 16, 2004 7:02 pm
- Location: CSE::BUET
- Contact:
Variable(int) bits....
We will, We will BREAK LOOP!!!!
-
- New poster
- Posts: 45
- Joined: Fri Jan 16, 2004 7:02 pm
- Location: CSE::BUET
- Contact:
-
- New poster
- Posts: 45
- Joined: Fri Jan 16, 2004 7:02 pm
- Location: CSE::BUET
- Contact:
The following should work:Heartattack! wrote: What can I use with VC++?
Declaring long long gives a 64bit int. Using cin/cout gives proper results. But I can't get printf() to work right in VC++. Any tips?
[cpp] printf("%I64d",long_num); // __int64
printf("%I64u",unsigned_long_num); // for unsigned __int64
[/cpp]
Last edited by shamim on Mon Nov 29, 2004 6:53 am, edited 1 time in total.
-
- New poster
- Posts: 45
- Joined: Fri Jan 16, 2004 7:02 pm
- Location: CSE::BUET
- Contact: