UPDATE Hm, I have an update. Apparently my huge array of "unsigned long long fhash[105][100555]" was not getting initialized to zero automatically in vC++... It worked when I did = {0}. Isn't it supposed to initialize automatically?
I'm doing contest programming, and I usually compile with g++ at school/ideone etc... but I have to use a VC++ 2010 compiler.
That said, I have code to do polynomial rolling hashing (like used in Rabin-Karp), but do these overflow differently on these compilers?
Code is here: http://pastebin.com/UFdpwHCt (hashing is around line 67)
Output is here: https://i.stack.imgur.com/03Np0.png
How come "bhash" is equal between the two compilers, but "fhash" isn't? They are hashed using the same method... In the G++-3 output, the "fhash" and "bhash" outputs are the same (they are supposed to be) but in the VC++-10 output the "fhash" and "bhash" aren't the same...
I'm using the overflow to let it mod itself naturally, to speed up execution, instead of explicitly modding it with a large prime.