Int vs Long long in BIT-wise operations ???

Правка en1, от ph2nkhang, 2025-05-19 18:16:50

(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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ph2nkhang 2025-05-19 18:16:50 794 Initial revision (published)