感想(廢話)+第三題題解昨天比了資訊月(比超屎,忘記最基礎的 /t),然後今天 APCS,所以我明天要請假~~
然後我覺得 APCS 現在改制後,題目應該會變成是:
初級:110(我不知道有沒有 0,當成超簡單或以前上古時期的 1)
中級:221
中高級:332
高級:443
然後 Python 觀念(現在改叫程式識讀),hmm,感覺還行啦,比 C 好一點,能感覺到超超超超穩 3,有蠻大機會能 4,運氣好能 5 的感覺。。
我覺得實作有拿滿 100% 的應該只有第三題,第一跟第二題我都只寫一維拿 60%,LOL。因為第一題真的好難。。。恐龍怎麼這麼能扛??
然後我第三題在 Zerojudge 拿下了 First blood 欸,酷。
題目說明:Zerojudge 題目連結
123456789101112131415161718192021222324252627from collections import defaultdicta = int(input())cnt = defaultdict(int)for _ in range(a): ...
以CPE 2025/9/30 第三題為例123456789101112131415161718192021222324252627282930313233You are given a string consisting of parentheses () and []. A string of this type is said to be correct:(a) if it is the empty string(b) if A and B are correct, AB is correct,(c) if A is correct, (A) and [A] is correct.Write a program that takes a sequence of strings of this type and check their correctness. Your program can assume that the maximum string length is 128.InputThe file contains a positiv ...
題目說明題目要求:
開啟 GPS
十分鐘內跑 1 英里(= 1.609344 公里)
有一個 Steps 計數,如果距離達標但 Steps 不夠,會要求重新跑。
我看到有人在大雨中跑了七公里才成功,哈哈。
解法一:真的跑
就跑,當千六在跑。
記得必須拿著手機跑,不然 Steps 會不夠。
解法二:假GPS作為駭客,我們當然不能真的跑!(不過我看 DC 群組應該只有我一個人這樣搞?)
GPS 部分
使用假 GPS(Play 商店隨便找都有)
Steps 部分
題目判定需要偵測手機搖動
不能用手機模擬器,所以只能手搖!
我搖了兩千多下,呵呵。
避免 Steps 跟不上距離
假 GPS 速度設定為 9 分鐘內跑完 1 英里
確保 Steps 和距離都達標
我是在開學當天的凌晨在搖的,運動完就睡不著,不嘻嘻。
overview~~The challenge gives oooo.py.
123#!/usr/local/bin/python3import random; FLAG = open("flag.txt", "rb").read(); print("welcome to oooo")while True: print(bytes(a^b for a, b in zip(FLAG, random.sample(range(0, 256), k=len(FLAG)))).hex() if input() != "exit" else exit())
quick ideaThe server gives hex(flag XOR keystream).The keystream is made with random.sample(range(0, 256), k=len(FLAG)), so all bytes in one response are different.
We know the flag ...
Q:什麼是動態規劃呢?A:有記憶的遞迴!
一般遞迴 Fibonacci123456def fib(n): if n <= 1: return n return fib(n-1) + fib(n-2)print(fib(10))
fib(n-1) 和 fib(n-2) 會被重複計算很多次
動態規劃 Fibonacci1234567891011memo = {}def fib(n): if n in memo: return memo[n] if n <= 1: memo[n] = n else: memo[n] = fib(n-1) + fib(n-2) return memo[n]print(fib(10))
將已計算過的結果存起來,可以大幅提高效率
硬幣 DP(找零的解法數)12345678910coins = [1, 2, 5]n = 5dp = [0]*(n+1)dp[0] = 1for c in coins: for i in range(c ...
建表123456789one_d = [0]*4two_d = [[0]*4 for _ in range(3)]print(one_d)print(two_d)# 輸出: [0, 0, 0, 0]# 輸出: [[0, 0, 0, 0],# [0, 0, 0, 0],# [0, 0, 0, 0]]
Lambda12345arr = [[1, 5], [2, 3], [1, 2]]arr.sort(key=lambda x: (x[0], -x[1]))print(arr)# 輸出: [[1, 5], [1, 2], [2, 3]]# 第一列升序,第二列降序
埃氏篩12345678def sieve(n): a = [True] * (n+1) a[0] = a[1] = False for i in range(2, int(n**0.5)+1): if a[i]: for j in range(i*i, n+1, i): a[j] = False return [i ...
第一天我爸超早就載我到中研院,我聽我朋友講,我甚至比工人還要早到,呵呵。早上吃了摩斯的牛肉堡,超好吃,btw 這應該是我人生中第三次吃摩斯。
第一天我蠻印象深刻的是開場的 「Atlantis:自主式 LLM 驅動的漏洞發現與修復系統」,能聽懂他講的英文,但是太電了,只能佩服。。。
午餐好吃,耶。
然後整個活動中,我最喜歡的議程是:「Uncover the Secrets of Chinese PhaaS Actor」超他媽好笑,直接把釣魚平台後面的中國人開盒,整個 R0 會議室裡面的人都在笑。
攤位我大概都走了三四輪,很酷。有一個中華資安國際辦的小遊戲,需要你寫一大堆 prompt 去面試,我有試了一下 prompt injection,但不行,就乖乖試怎樣才能拿到 offer。最後我刷到最後一隻豬豬了!
最後,我只記得從中研院騎出去找不到 ubike 停車站。
第二天依舊很早到這一塊 ./依舊吃牛肉堡這一塊 ./
第二天的話,我只記得便當一樣好吃,還有 Orange Tsai 的:「The Art of PHP — My CTF Jo ...





