We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The function you are asked to complete takes vector<int> as input but the question stipulates that A[i] is less than 10^18, so int will not do, long is needed.
- Change the function input to vector<long>,
- Change the code in the main function to read longs using stol() instead of stoi()
This question is well worded (in my opinion) and really rewarding otherwise. If you are stuck, research NIM, the Sprague Grundy function, and XOR.
Always check the specifications :P
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Prime Game
You are viewing a single comment's thread. Return to all comments →
IMPORTANT
There is an issue with the C++ starter code.
The function you are asked to complete takes
vector<int>
as input but the question stipulates that A[i] is less than 10^18, so int will not do, long is needed. - Change the function input tovector<long>
, - Change the code in the main function to read longs using stol() instead of stoi()This question is well worded (in my opinion) and really rewarding otherwise. If you are stuck, research NIM, the Sprague Grundy function, and XOR.
Always check the specifications :P