程設助教 judge 題目
助教:蘇子權 SubaRya
題目:
* 作業連結
* 分配: hw0101, hw0102
hw0101
測資分數分配
- sunny case: 13 pt
- other case: 7 pt
透過 function 評分,見下表
評測函式 | sunny case pt | other case pt |
---|---|---|
strchr | 1 | 1 |
strrchr | 2 | 1 |
strspn | 2 | 1 |
strcspn | 2 | 1 |
strpbrk | 2 | 1 |
strstr | 2 | 1 |
strtok | 2 | 1 |
- sunny case
char str1[] = "SubaRya TA is handsome";
char str2[] = "Smallten and Mafumafu are cute";
char str3[] = "jw910731, LoveSnowEx, Smallten, SubaRya, NTNU students, also Computer Programming II TA, work hard";
other case
- 上面的 link 中
.txt
副檔名的檔案
- 上面的 link 中
簡述
- sunny case 測資較小,從
hw0101.c
中可以看出來,這裡不多做說明。 - other case 測資較大,透過 mmap 吃進 file 中的 content,進行評測。
- 有使用
sigsetjmp
、signal
偵測 segmentation fault 或 infinite loop 的情形產生,以不會測到一半被 terminate 而沒測到後續的功能。
- sunny case 測資較小,從
hw0102
測資分數分配
- sunny case: 12 pt
- 含一筆越界 position
- other case: 8 pt
- sunny case: 12 pt
共 10 筆測資,每一筆兩分。
簡述
generateTestcaseAndAns
folder 裡有用 python 寫的 generate testcase and answer 的程式,可以自行拿來檢測。- sunny case 測資較小,長度約略 100,透過 mmap 吃進 file 中的 content,評測後將結果與
ans<1~6>.txt
比對。 - other case 測資較大,長度約略 2e7,透過 mmap 吃進 file 中的 content,評測後將結果與
ans<7~10>.txt
比對。 - 有使用
sigsetjmp
、signal
偵測 segmentation fault 或 infinite loop 的情形產生,以不會測到一半被 terminate 而沒測到後續的功能。