2772 - 2023GEC1506 - HW3 Scoreboard

Time

2023/04/10 20:00:00 2023/04/23 23:59:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team
1 13465 - max/min in assigned area smol_bun Hello, I want to ask how we should deal with indicator "f/b" + k numbers when k exceeds the numbers we have. Should we return None or accept it as comparing it against all numbers in the list? Thank you It will not happen. k will not exceeds the numbers we have GEC_PY_JUDGE 2023/04/12 09:29:25
2 13465 - max/min in assigned area 110590032 不好意思,我剛剛寫完第一題覺得題目敘述不夠清楚, 像b/f後面數字會出現的範圍是多少, 以及testcase中的數字範圍是多少都不太明確, 比如可能b/f後面的數字出現會超出list_length的情況之類的, 謝謝助教和教授。 4/23 更新,b/f後面的數字不會出現超出 list_length(此時是有涵蓋 indicator 的情況),但如果是撇除 indicator 的狀況,b/f 會在其中一側資超過有效數字,遇到這種狀況則需要比較整個可能有效數字 GEC_PY_JUDGE 2023/04/23 16:33:02
3 13473 - Scoreboard Parsing (cheat) GEC_108010018 不好意思,我自己在colab寫的程式在複製貼上sample input之後可以跑出和sample output一樣的結果。但不知道為什麼在上傳OJ以後發現連一個case都過不了,所以想問一下可能是發生了什麼問題,input_data之間的間隔是換行還是空一格即可? Input data 的格式是和範例一樣喔~不確定你說 input_data 之間的間隔是指一組測資會有幾組 input 嗎? 如果是的話都只有一組喔,都是由三個 part 合起來的一組input GEC_PY_JUDGE 2023/04/15 18:46:31
4 13473 - Scoreboard Parsing (cheat) 110000161 I want to ask about the advanced problem one. When does my code print out the result? Because I don't when the loop (to receive input) will break. Thank you. You can do your instruction(such as print) after receiving all the data(end of while loop). The break only breaks the while loop but not breaks all the program GEC_PY_JUDGE 2023/04/15 18:46:35
5 13473 - Scoreboard Parsing (cheat) GEC_110006223 I want to ask, when will the user indicates when to stop putting their inputs? When you meet EOF(end of file) in the input. GEC_PY_JUDGE 2023/04/19 13:43:13
6 13465 - max/min in assigned area GEC_110006426 About the advanced problem, I would like to ask if the number of tests is always three or if it can be multiple. it can be multiple. GEC_PY_JUDGE 2023/04/16 14:08:40
7 13465 - max/min in assigned area wayne111061232 想請問關於第一題的描述"If the blue elements are the same number, the input can sometimes only give i1 or i2 without b or f info. This is considered valid input."是指所有數字都要一樣時,才可以不輸入b跟f info嗎?還是不一定要所有數字都相同也可以不輸入b跟f info呢?另外test case的範圍是否包含各種不有效的輸入,比如:有兩個i info or b、f info,出現i、b、f以外的英文字母,i後面出現1、2以外的數字,這些情況我需要考慮嗎?希望input的範圍能給明確一點,謝謝助教 4/23更新 所有數字都要一樣時,才可以不輸入b跟f info嗎? 對。 test case 的範圍僅限描述中有提到的 1: 正常情況 2: 4.1 的描述 3: 4.2 的描述 4. 4.3 的描述 GEC_PY_JUDGE 2023/04/23 16:34:30
8 13465 - max/min in assigned area GEC_109006255 Can We use the command elif for this assignment. I tried but I see it grayout. Yes, you could use elif command for the assignment. GEC_PY_JUDGE 2023/04/19 13:43:54
9 13465 - max/min in assigned area GEC_109006255 4.2. If the number behind b or f is 0, such as b0, it is considered an empty range. The input is considered non-valid input. in this part the number behind is like this 0,b or 0b however in the problem you give the example of b0, however there in 0 is in front and not behind, can you please clarify this? Thank you in advance Dear Ta There would only be b0 in this problem. GEC_PY_JUDGE 2023/04/19 13:43:45
10 13473 - Scoreboard Parsing (cheat) GEC_110006223 Hi I want to ask, I got partially accepted 4/6. The 4th and 5th testcase are wrong. What could be the problem? You may not consider the edge case. GEC_PY_JUDGE 2023/04/23 12:12:29
11 13465 - max/min in assigned area DSK110590026 Hello TA,I found that the number range you announced [0,list_length] is actually the list of input_data ,which means it includes "i","b","f" ,so I think [0,list_length] might cause a confusion between if the "list" meant the one without counting those indicators,thank you TA and professors yes, you are right. Thanks for your clarification. GEC_PY_JUDGE 2023/04/23 16:31:51
12 13473 - Scoreboard Parsing (cheat) DSK110590007 請問助教作業評分是依照對的測資數量比例算分還是要AC才有分? 依照測資數量比例給分喔~ GEC_PY_JUDGE 2023/04/23 12:13:18
13 13465 - max/min in assigned area DS23_110080013 Why my program ends when I input EOF? I think it is because you use try...except, and when it comes to EOF, you break the program. However, if you use the sample code While True: try: except: break It only stop the while-loop, you can still do other operations after while-loop GEC_PY_JUDGE 2023/04/23 22:49:42

# Problem Pass Rate (passed user / total user)
13465 max/min in assigned area
13473 Scoreboard Parsing (cheat)

13465 - max/min in assigned area   

Description

Given a list of numbers, an some indicators,

you need to find out the maximum or minimum number in the list according to the indicators.

 

Input

There is only one line in the input, which contains the list of numbers and some indicators.

An example is shown below.

9,0,21,i1,61,66,f5,91,62,22,22

Note that

  1. The red element in the line is an indicator where you can find it start with the character "i" and followed by a digit. (1 in this example). When you meet "i1", you need to find the maximum; and "i2" to find the minimum.
  2. The green element in the line is also an indicator. It starts from either "f" or "b" and followed by a number k. ("f5" in this example). The character "f" stands for "front". It means you need to find the answer from the first k numbers. The character "b" stands for "back". It means you need to find the answer from the last k numbers. In this case, "f5" means you need to find the answer from the first 5 numbers. When there is no this kind of indicator, you need to find the answer from all the numbers. ( Please note that there would be only one indicator like this. )
  3. The remaining blue elements are the numbers of the list of numbers.
  4. You need to consider some edge cases, such as
    4.1. If the blue elements are the same number, the input can sometimes only give i1 or i2 without b or f info. This is considered valid input.
    4.2. If the number behind b or f is 0, such as b0, it is considered an empty range. The input is considered non-valid input.
    4.3 If the input without i indicator. The input is consider non-valid input
  5. If the input is not valid, print "None" instead.

Output

The output is a line of text with the maximum/minimum number from the list.

Sample Input  Download

Sample Output  Download

Tags




Discuss




13473 - Scoreboard Parsing (cheat)   

Description

Calculate the score of students from the NTHU OJ scoreboard based on how many test cases a student has passed.

This is a continued problem from Problem 13849. (https://acm.cs.nthu.edu.tw/problem/13849/)

In this problem, we are going to handle the situation that there are some users who cheat on certain problems.

Input

The input consists of three parts as demonstrated below.

0.5 0.25 0.25

1,106095014,3/3,1/1,1/1,5
2,106095029,3/3,1/1,0/1,5,d1,d3
3,GEC2_105072127,1/3,1/1,0/1,5,d1

X014
X2127

  1. The first line (highlighted in yellow) is the weights for each problem in the contest where you need to apply the "weighted average" to calculate the final score for each user.
     
  2. The second part is the lines highlighted in green background. Each line describes the answering record for the given user and there could be more than 3 lines in this part.

    The syntax of each line is explained by this example:

    2,106095029,3/3,1/1,0/1,5,d1,d3

    Rank, User, Problem 1 Result, Problem 2 Result, ... , Problem N Result, Total Passed Cases, ignored answers, ...

    where you can ignore the rank and calculate the weighted average for each problem according to the weights provided in the 1st line. The formula of the weighted sum is provided below.

    weighted average
    where w denotes the weight and x denotes the score for each problem.

    For the ignored answers, it denotes the user who cheated on the specific problem and you need to set the scores of that problem to be "0". For example, we have "d1, d3" which indicates that this user (106095029) cheated on problems 1 and 3. Thus, we need to set the scores for these two problems as 0 and the final score should only accumulate from the remaining problems, i.e. problem 2 in this case.
    Note that the weights are not affected by the cheating. It is still 0.5, 0.25, and 0.25 for problem 1, 2, 3, respectively.
    Finally, this user only gets 25 points contributed by problem 2, which has a 0.25 weight and obtains a 100 point score.
     
  3. The last part is the lines highlighted in red background. These lines indicate the users who cheated for the entire contest and, therefore, their final score should be directly set as 0. (Note that it is optional to have this part.)

    In the given example above, the scores for the records that its username ended with 014 or 2127 should be set as 0.

 

Output

The score for each student of the given contest with the format:

User,Score

Note that

  1. The order of the output score should follow the same order as the input. That is, you can not ignore any record from the input. E.g. let's say there are 10 input records, you need to output 10 scores corresponding to the input records.
  2. The score should have 2 decimals.

Sample Input  Download

Sample Output  Download

Tags




Discuss