Unsigned long long int

I sent the code of the exponent of the matrix in C to find the nth fibonacci, and I used the long long int variable to store the response modulo 10000007 of the nth fibonacci, and the judge gave the “time limit exceeded”, but when I used “unsigned long long int "my code was accepted during this time and the execution time was reduced.

I was not able to understand why long long enters "time limit exceeded" and "unsigned long long int" was accepted? (The answers to the extreme tests were correct in both cases)

+4
source share
1 answer

In order not to repeat any efforts, see this question and this more complex questions and answers of the same topic. dthorpe answer in this one is very detailed. wheaties ' first comment here is worth checking out as the first test.

+5
source

Source: https://habr.com/ru/post/1397158/


All Articles