→ mjsg:會不會是最後的分行問題,我沒仔細看過python的split()他的敘 04/02 11:53
→ mjsg:敘,但是python的split('\n')最後都會多一個''(空字串)… 04/02 11:54
→ mjsg:還是聽聽別人的意見(只會3k的open後.read().split('\n')[-1] 04/02 11:57
有時候TLE 有時候WA 有時runtime error (NZEC)
我都搞混了....不懂怎麼會這樣 寫C都不會qq
※ 編輯: KitWoolsey 來自: 218.166.105.130 (04/02 12:03)
→ KSJ:請問什麼是wa什麼是tle什麼是nzec@@a
1. AC - accepted - your program ran successfully and gave a correct answer.
Congratulations, you have solved the problem!
2. WA - wrong answer - your program ran successfully, but gave an incorrect
answer. Most probably your program contains a bug, or you are not
interpreting the problem text correctly.
3.TLE - time limit exceeded - your program was compiled successfully, but it
didn't stop before time limit. This may be because the algorithm is badly
designed (too slow), or because it contains a bug, e.g. it goes into an
infinite loop, or hangs up, expecting some input data.
4.CE - compilation error - your program couldn't be compiled; the details of
the compiler error can be accessed from the www interface. Note: only some
programming languages can give a CE, syntax errors in interpreted languages
may instead be displayed as WA (for example, in Python there is no
pre-checking of syntax, and in Perl, CE will only occur sometimes if the
error is detected during a preliminary syntax check).
5. RE - runtime error - your program was compiled successfully, but it exited
with a runtime error or crashed. You will receive an additional error
message, which is most commonly one of the following:
* SIGSEGV (signal 11) - the most common error for non-interpreted
languages: a "segmentation fault" of the program. This may be caused e.g. by
an out-of-scope array index causing a buffer overflow, an incorrectly
initialized pointer, etc.
* SIGXFSZ (signal 25) - "output limit exceeded". Your program has printed
too much data to output (typically more than 25MB).
* SIGFPE (signal 8) - "floating point error" - an error of the arithmetic
co-processor, such as division by zero, etc.
* SIGABRT (signal 6) - raised by the program itself, e.g. by making the
abort() system call. Note that STL in C++ can raise this signal under some
conditions, e.g. due to insufficient memory.
* NZEC (non-zero exit code) - this message means that the program exited
returning a value different from 0 to the shell. For languages such as C,
this probably means you forgot to add "return 0" at the end of the program.
For interpreted languages (including JAVA) NZEC will usually mean that your
program either crashed or raised an uncaught exception.
* other - there are other signals which can cause program to terminate,
all the remaining ones are simply displayed as other.
04/02 12:57
不知道Python有沒有要像C語言一樣加個類似return 0;的東西在最後=.=?
※ 編輯: KitWoolsey 來自: 218.166.111.242 (04/02 13:00)
→ KSJ:看教學查到前兩個了XD 04/02 12:59
→ KSJ:default是return None的樣子 04/02 13:05
→ KSJ:可以看一下你的ccode嗎? 04/02 13:13
→ tkcn:多寫幾題遇過各類型 input,之後就會很容易了 04/02 14:50
推 cobrasgo:老實說我看不太懂這個python code為何有做到題目所講的東 04/03 01:21
→ cobrasgo:西,計算!和0的部份在哪裡? 04/03 01:22
推 cobrasgo:拍謝,眼殘沒看到x//5... 04/03 17:31