나는 IDE에서 정답을 얻고 있지만, 온라인 판사는 다음과 같은 오류를 제공합니다 :"잘못된 문자 오류"가있는 이유는 무엇입니까?
Traceback (most recent call last):
File "/tmp/editor_trsource_1410281976_804149.py", line 10, in
n=int(raw_input(''))
ValueError: invalid literal for int() with base 10: '100 10'
문제 링크 : http://www.hackerearth.com/problem/golf/minimal-combinatorial/
def fact(x):
f=1
while x>0:
f=f*x
x-=1
return f
T=int(raw_input(''))
while T>0:
n=int(raw_input(''))
r=int(raw_input(''))
ans=fact(n)/(fact(r)*fact(n-r))
print str(ans) + "\n"
T-=1
여전히 오류 : 트레이스 백 (지난 최근 통화) 파일 "/tmp/editor_trsource_1410455624_65093.py"라인 (16), N = NR [0]에 IndexError : 범위 밖의리스트 인덱스 –