原创 hdu 1573 A/B (擴展歐幾里得)

Problem Description 要求(A/B)%9973,但由於A很大,我們只給出n(n=A%9973)(我們給定的A必能被B整除,且gcd(B,9973)= 1)。     Input 數據的第一行是一個T,表示有T組數據。 每

原创 hdu 1396 Counting Triangles(遞推)

Counting Triangles Problem Description Given an equilateral triangle with n thelength of its side, program to count how

原创 ACM HDU 2674 N! Again(數論)

繼續數論。。 Problem Description WhereIsHeroFrom:            Zty,what are you doing ? Zty:                                  

原创 hdu 1788 Chinese remainder theorem again(最小公倍數)

Problem Description 我知道部分同學最近在看中國剩餘定理,就這個定理本身,還是比較簡單的: 假設m1,m2,…,mk兩兩互素,則下面同餘方程組: x≡a1(mod m1) x≡a2(mod m2) … x≡ak(mod

原创 hrbust 1328 相等的最小公倍數(數論)

Description 定義An爲1,2,…,n的最小公倍數,例如,A1 = 1,A2 = 2,A3 = 6,A4 = 12,A5 = 60,A6 = 60。 請你判斷對於給出的任意整數n,An是否等於An – 1。 Inpu

原创 ACM Sdut 2158 Hello World!(數學題,排序) (山東省ACM第一屆省賽C題)

題目描述 We know thatIvan gives Saya three problems to solve (Problem F), and this is the firstproblem.“We need a programme

原创 Sdut 2164 Binomial Coeffcients (組合數學) (山東省ACM第二屆省賽 D 題)

Binomial Coeffcients TimeLimit: 1000ms   Memory limit: 65536K  有疑問?點這裏^_^   題目描述   輸入   輸出   示例輸入 3 1 1 10 2 954 723

原创 ACM HDU Primes(素數判斷)

Problem Description Writea program to read in a list of integers and determine whether or not eachnumber is prime. A nu

原创 Sdut 2151 Phone Numbers (山東省ACM第一屆省賽題 A)

題目描述 We know thatif a phone number A is another phone number B’s prefix, B is not able to becalled. For an example, A i

原创 hdu 1018 Big Number (數學題)

Problem Description Inmany applications very large integers numbers are required. Some of theseapplications are using k

原创 Sdut 2416 Fruit Ninja II(山東省第三屆ACM省賽 J 題)(解析幾何)

Time Limit: 5000MS Memory limit: 65536K 題目描述   Haveyou ever played a popular game named "Fruit Ninja"? Fruit Ninja (kno

原创 Poj 1061 青蛙的約會(擴展歐幾里得)

Description 兩隻青蛙在網上相識了,它們聊得很開心,於是覺得很有必要見一面。它們很高興地發現它們住在同一條緯度線上,於是它們約定各自朝西跳,直到碰面爲止。可是它們出發之前忘記了一件很重要的事情,既沒有問清楚對方的特徵,也沒有

原创 Sdut 2409 The Best Seat in ACM Contest(山東省第三屆ACM省賽 H 題)(模擬)

題目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends AC

原创 2014-4-27 心情

    今天回到宿舍以後,宿舍就剩自己了,然後就胡思亂想了。。    雖然最近一直在各個OJ上做題,但是感覺進步很少,ACM需要的知識太多了,自己會的就太少了,突然就喪失信心了。。 然後找了一個小夥伴聊天,他的一句話讓我稍微清醒了點,他說

原创 Hdu 1452 Happy 2004(除數和函數,快速冪乘(模),乘法逆元)

Problem Description Considera positive integer X,and let S be the sum of all positive integer divisors of2004^X. Your j