Блог пользователя ph2nkhang

Автор ph2nkhang, история, 12 месяцев назад, По-английски

(First of pardon my English)

So I was today years old when I found out that the data type can somehow affect the way the program handles bit-wise operations? I mean to me it doesn't really make sense, if they're all just an integer type why does the size even matter?

This is what I bumped into:

Problem: https://marisaoj.com/problem/523 In short you are given n strings, count the number of subsets of strings that contains all letters of the alphabet.

Here is the code that returns runtime error: https://ideone.com/KEAK8L Here is the code that gets accepted: https://ideone.com/ymz85I

The only difference is declaring my variables as int or as long long type.

If someone can, PLEASE explain it to me, I find this very confusing.

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

long long is 8 bytes, int only 4. If you use 2^26 long longs, you get MLE.