nzec error in codechef while writing code in python -


this code giving runtime error (nzec) when compile in codchef.

test_cases = int(raw_input()) result = 0 def output(x):     if(x/2 >= 2):         global result;         result += x/2 - 1;         output(x-2);     else:         print result;         result = 0;  while(test_cases > 0):     base = int(raw_input());     output(base);     test_cases = test_cases - 1; 

nzec error thrown code in codechef if there exception thrown. input not work c, c++ while using python on codechef -

you can use

import sys test_cases = sys.stdin.read().split() 

now iterate on test_cases. more info here

also use sys.stdout.write() outputs rather print


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -