ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2135. Pauline and commits

TL13
Posted by Andrewy 5 Aug 2019 16:21
My solution is O(n) (<=60 * n iterations) but I have TL on python
Help me to read fast data input

My input code:
n, l, r = map(int, input().split())

tokens = sys.stdin.read().split()
a = list(map(int, tokens))
Re: TL13
Posted by 👨‍💻tproger👨‍💻[GTGU] 6 Aug 2019 19:45
Example of fast input/output in python is here:
www.geeksforgeeks.org/python-input-methods-competitive-programming/

Edited by author 06.08.2019 20:21
Re: TL13
Posted by Andrewy 7 Aug 2019 13:54
Thx But I solved problem using C++. The same algo but new implementation (added
if ((prod  / (double)1000000000) * a[j-1]> 1000000000) j = 0;
                else prod *= a[j-1];)

Edited by author 07.08.2019 13:55