## 7/16 ```python # for reading line input containg several int list(map(int,input().split(" "))) ``` 1. https://open.kattis.com/problems/judgingmoose 2. https://open.kattis.com/problems/speedlimit 3. 1A2B:電腦出題讓玩家猜,告訴玩家?A?B ## 7/18 1. https://open.kattis.com/problems/tetris (Hard) 2. https://open.kattis.com/problems/toktik (Easy) 3. https://open.kattis.com/problems/babybites (Easy) 4. https://open.kattis.com/problems/tarifa (Easy) ## 7/22 1. https://open.kattis.com/problems/nodup (easy) 2. https://open.kattis.com/problems/sevenwonders (easy) 3. https://open.kattis.com/problems/weakvertices (hard) ## 7/23 1. https://open.kattis.com/problems/soylent (easy) 2. https://open.kattis.com/problems/cetiri (easy) 3. https://zerojudge.tw/ShowProblem?problemid=a290 (Hard) ## 7/29 ```python f=open("filename","mode") f.read() f.write() ... ``` https://www.w3schools.com/python/python_file_handling.asp https://www.runoob.com/python/python-func-open.html ## 7/30 File: [words.txt](https://drive.google.com/file/d/1MkWOOZ3Ms0xixUv00rhhD5qU5GMQAcqS/view?usp=drivesdk) Have the user choose following function - Rank the letters (case insensitive) according to their numbers of appearances in descending order. - How many words have the same first and last letters? - List the words that are unchanged when reversed. - Find the sets of words that can be derived from each other by arranging the comprising letters. - Input letter, and caculate how many words start/end with the input letter. ## 8/1 1. 1A2B Guesser (TODO) 2. https://zerojudge.tw/ShowProblem?problemid=b291 ## 8/5 1. 隨便kattis兩題 2. https://zerojudge.cchs.chc.edu.tw/ShowProblem?problemid=a320 3. ZJ b291 ```python n=int(input()) data={} ani=[] an=set() for _ in range(n): animal,count,loc=input().split() if animal not in an: ani.append(animal) an.add(animal) count=int(count) locd=data.get(loc,{}) locd[animal]=locd.get(animal,0)+count data[loc]=locd s="" for loc,locd in data.items(): s+=loc+" : " sa=sorted(locd,key=ani.index) for animal in sa: s+=animal+" "+str(locd[animal])+", " s=s[:-2] s+="\n" s=s[:-1] print(s) ``` ## 2025/1/20 https://open.kattis.com/problems/oddities https://open.kattis.com/problems/stopwatch