原创 Humble Numbers(打表)

Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Problem Description A number whose

原创 A + B Problem II(大數加法)

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 522761

原创 Spreadsheet

Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Problem Description In 1979, Dan B

原创 PAT乙級 1007 素數對猜想(歐拉篩法)

題目鏈接 https://pintia.cn/problemsets/994805260223102976/problems/994805317546655744 讓我們定義d​n​爲:dn=pn+1−pn,其中pi​​是第i個素

原创 PAT乙級 1012 數字分類(測試點8)

測試點8考察的是A2=n1-n2+n3-n4…正好等於0的時候,應該輸出0而不是N。 解決方法,設一個變量num2,記錄下A2讀入了幾個數,num2爲0輸出N,否則輸出0。 C #include <stdio.h> #includ

原创 一個及其簡單的打字遊戲

大一期末要交個C語言遊戲+答辯,先來個小遊戲練練手 一個簡易的打字遊戲,難得註釋寫的很全,就放上來了 有錯歡迎指出,遊戲有愛自取 C #include <stdio.h> #include <stdlib.h> #include

原创 How Many Answers Are Wrong(邊帶權並查集)

題目鏈接 http://acm.hdu.edu.cn/showproblem.php?pid=3038 根據前面的回答判斷下一個回答是否矛盾,因爲判斷下一個回答要根據前面的回答,所以用並查集來記錄前面數之間的關係,如果根據前面

原创 PAT乙級 1008 數組元素循環右移問題

同樣,寫給自己,以前只會再開一個數組和暴力右移,這次學到了新的方法,記錄一下。 有數組123456,要右移兩次,可以分成1234和56兩塊,兩塊都左右交換,變成4321和65,432165再左右交換即可變成561234(這步可以

原创 Molecular Formula

Time Limit : 2000/1000ms (Java/Other) Memory Limit : 60000/30000K (Java/Other) Problem Description Your mission i

原创 骨牌鋪方格

Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Problem Description 在2×n的一個長方形方格中,

原创 Elevator

Problem Description The highest building in our city has only one elevator. A request list is made up with N positi

原创 The Hardest Problem Ever

Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced w

原创 A+B for Input-Output Practice (II)

Problem Description Your task is to Calculate a + b. Input Input contains an integer N in the first line, and then

原创 A+B for Input-Output Practice (IV)

Problem Description Your task is to Calculate the sum of some integers. Input Input contains multiple test cases. E

原创 看看你的編譯器是否允許嵌套註釋

出自《C陷阱與缺陷》 練習1-1 某些C編譯器允許嵌套註釋。請寫一個測試程序,要求:無論是對允許嵌套註釋的編譯器,還是對不允許嵌套註釋的編譯器,該程序都能正常通過編譯(無錯誤消息出現),但是這兩種情況下程序執行的結果卻不相同。 答