AtCoder Beginner Contest 331 解題紀錄 (A - E)
AtCoder Beginner Contest 331 題解 (A - E) 只寫出了4題,感覺 pD 就差臨門一腳了,繼續努力吧 ~ All problems solved by python A - Tomorrow (abc331 A) 題意 給你一年的月份MMM和每月的天數DDD,給定一個日期 yyy年mmm月ddd日,輸出明天的日期。 思路:簡單模擬 將日期+1後計算有沒有溢位即可。 1234567891011M, D = map(int, input().split())y, m, d = map(int, input().split())d += 1 if d > D: d = 1 m += 1if m > M: m = 1 y += 1print(y, m, d) B - Buy One Carton of Milk (abc331 B) 題意 給定需要購買的雞蛋數NNN,以及購買666個、888個、121212個雞蛋的價格SSS、MMM、LLL,求購買 至少 NNN...
Codeforces Round 912 (Div. 2) A - C
Codeforces Round 912 (Div. 2) A - C pB思路沒錯,結果計算時的條件判斷沒寫好,rejudge後WA了,難受。但不管如何,人菜就是要多補題。 All problems solved by python A - Halloumi Boxes (CF1903 A) 題意 給出一個長度為 nnn 的Array aaa,每次可以選擇一個長度最多為 aaa 的子陣列進行反轉,問是否能夠使aaa排序成非降序。 思路:Bubble Sort 對於 k≥2k \geq 2k≥2 的情況,我們可以模擬Bubble Sort的過程,故只要 k≥2k \geq2k≥2 就一定可以使 aaa 排序成非降序。 對於 k=1k = 1k=1 的情況,則無法做排序,故只要 $a $中存在 ai−1>aia_{i-1} > a_iai−1>ai 的情況,就無法使 aaa 排序成非降序。 12345678910111213141516171819T = int(input())def check(A): # A是否為升序 for i in...
LeetCode Weekly Contest 374 解題紀錄
第13次的LeetCode週賽。那一天,人類終於回想起了,只寫出1題的絕望。
LeetCode 2023/12 每日一題 (Dec LeetCoding Challenge) 目錄
A collection of LeetCode 2023/12 daily challenge.
LeetCode 2023/12/01-2023/12/10 每日一題
A collection of LeetCode 2023/12 daily challenge. Part 1 from 12/01 to 12/10.
Codeforces Round 909 (Div. 3) A - F
Codeforces Round 909 (Div. 3) A - F 補題補題。 All problems solved by python A - Game with Integers (CF1899 A) 題意 兩個人玩遊戲,給定一個數 NNN , 每人能夠對數字進行執行 +1+1+1 或 −1-1−1 的操作,若操作完 NNN 是 333 的倍數則該名玩家獲勝,但若超過10次操作沒有結果,則後手獲勝,問先手的人能否獲勝。 思路 若第一輪先手無法獲勝,則後手必可以將先手的操作抵銷,故先手獲勝的條件是第一次操作就能獲勝,即 N mod 3N \bmod 3Nmod3 餘 111 或 222。 12345678T = int(input())for _ in range(T): N = int(input()) if N % 3 == 0: print("Second") else: print("First") B - 250 Thousand Tons of TNT...
LeetCode Weekly Contest 373 解題紀錄
第12次的LeetCode週賽。好像是離AK最近的一次,Q4前兩個關鍵點都想到了,就差臨門一腳了,可惜了。
LeetCode Biweekly Contest 118 解題紀錄
第11次的LeetCode週賽。
LeetCode 2023/11 每日一題 (Nov LeetCoding Challenge)
A collection of LeetCode 2023/11 daily challenge.
AtCoder Beginner Contest 317 題解 (A - E)
我好菜啊我好菜啊我好菜啊
AtCoder Beginner Contest 315 題解 (A - F)
為第一次打AtCoder做準備 ~
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick Start Create a new post 1$ hexo new "My New Post" More info: Writing Run server 1$ hexo server More info: Server Generate static files 1$ hexo generate More info: Generating Deploy to remote sites 1$ hexo deploy More info: Deployment