Skip to content

Instantly share code, notes, and snippets.

@aben20807
Last active January 5, 2023 08:47
Show Gist options
  • Save aben20807/10146edb54989c2cd72671c225dc3eb1 to your computer and use it in GitHub Desktop.
Save aben20807/10146edb54989c2cd72671c225dc3eb1 to your computer and use it in GitHub Desktop.
成大資工博士畢業點數計算
from typing import Union
def cal(L: Union[str, int], i: int, N: int) -> float:
global cnt
cnt += 1
assert L == "A" or L == "B" or L == "C" or isinstance(L, int)
# T: A6;B4;C2
T = 6 - 2 * (ord(L) - ord("A")) if isinstance(L, str) else L
d = sum([2 ** (-j) for j in range(1, N + 1)])
sc = T * (2 ** (-i)) / d
sc = round(sc, 2)
print(f"{cnt}:\t{sc:.2f}")
return sc
if __name__ == "__main__":
cnt = 0
# 公式來源: 國立成功大學資訊工程學系博士班學位考試辦法 (https://www.cc.ncku.edu.tw/rule/content.php?sn=2044) 伍、(四)
# T*2^(-i)/(sigma_{j=1 to N}(2^(-j)))
# 其中 T 為該論文所屬期刊或會議的點數,
# i 為申請人在該論文的排名順序
# N 為該論文的作者總數(指導教授排名不計)
# (T, i, N), e.g., ("B", 1, 2) 代表 B 級論文、第一作者、除了指導教授外有兩位作者
papers = [
("B", 1, 1),
("B", 1, 2),
("A", 1, 5),
]
total = sum([cal(*i) for i in papers])
print(f"Total:\t{total:.2f}")
$ python3 phd_points.py
1: 4.00
2: 2.67
3: 3.10
Total: 9.77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment