Constraints in Python

Can someone help me regarding constraints setting in python ? When constraints are of the form 1<S<= 10^6 …I often find my code failing subtask too . Something similar happened in the contest too (Bella Ciao ) question. Py3 doesn’t support Long …someone pls help. And pls don’t tell that I would have to learn CPP…I will but I want find the way around Python 3. Please.

Generally the constraints on input values is something you can assume in the competitions - you don’t need to check them. In Python, all integers are of unlimited size, so there is no long or long long or any other need for large integer support - it’s all right there in int. One thing to bear in mind is that (for example) range(1000) does not include the value 1000 - the 1000 values represented start at 0 and end at 999

2 Likes

But my subtask has been failing in terms of constraints. Bella Ciao of June Long Challenge has failed in subtask 2 .

Are you getting WA or TLE?

No discussion on problem of ongoing contest