原创 2018年湘潭大學程序設計競賽 E 吃貨(貪心,二分)

鏈接:https://www.nowcoder.com/acm/contest/105/E來源:牛客網時間限制:C/C++ 1秒,其他語言2秒空間限制

原创 ACM-ICPC 2018 徐州賽區網絡預賽 A. Hard to prepare(dp)

鏈接:https://nanti.jisuanke.com/t/31453 問題描述:n個人圍在一起,每一個可以在2^k-1這些數種選擇一個,不過要求保證相鄰的兩個數保證XNOR不爲0,(1 XNOR 1 = 1, 0 XNOR 0=1,

原创 HDU-6395-Sequence (矩陣快速密, 加整數分塊)

原題:http://acm.hdu.edu.cn/showproblem.php?pid=6395 分析:題意是給一個了數列遞推式,問第n項取模的值。這道題的範圍很大所以沒法使用直接跑循環地推的方法求第n項,很容易就能分析出應該轉化成矩

原创 Codeforces Round #485 (Div. 2) E. Petr and Permutations

E. Petr and Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard

原创 2018 Multi-University Training Contest 3 Problem F. Grab The Tree

原題:http://acm.hdu.edu.cn/showproblem.php?pid=6324   Problem Description Little Q and Little T are playing a game on a t

原创 2018 ACM 國際大學生程序設計競賽上海大都會賽重現賽 J-Beautiful Numbers

鏈接:https://www.nowcoder.com/acm/contest/163/J   題目描述 NIBGNAUK is an odd boy and his taste is strange as well. It seems

原创 Codeforces Round #485 (Div. 2) A. Infinity Gauntlet

A. Infinity Gauntlettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outp

原创 HDU6335 Problem D. Nothing is Impossible

原題:http://acm.hdu.edu.cn/showproblem.php?pid=6335 Problem Description m students, including Kazari, will take an exam t

原创 HDU6386-Age of Moyu

Age of Moyu Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s):

原创 素數分解和合數篩選

根據唯一分解定理,任何一個數都可以分解成若干個素數的乘機,代碼如下: //factor[i][0]存放分解的素數 //factor[i][1]存放對應分解的素數出現的次數 //fatCnt存放分解出的素數的個數(相同出現的只算一次) #

原创 Wannafly挑戰賽21 C大水題

原題:https://www.nowcoder.com/acm/contest/159/C   題目描述 現在給你N個正整數ai,每個數給出一“好數程度” gi(數值相同但位置不同的數之間可能有不同的好數程度)。對於在 i 位置的數,如果

原创 2018百度之星資格賽 1002子串查詢

Problem Description 度度熊的字符串課堂開始了!要以像度度熊一樣的天才爲目標,努力奮鬥哦! 爲了檢驗你是否具備不聽課的資質,度度熊準備了一個只包含大寫英文字母的字符串 A[1,n] = a_1 a_2 \cdots a_

原创 2018 ACM 國際大學生程序設計競賽上海大都會賽重現賽 D-Thinking-Bear magic

鏈接:https://www.nowcoder.com/acm/contest/163/D 來源:牛客網   題目描述 In order to become a magical girl, Thinking-Bear are learni

原创 Codeforces Round #485 (Div. 2) C. Three displays

C. Three displaystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputI

原创 Codeforces Round #485 (Div. 2) D. Fair

D. Fairtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputSome compa