数学--数论--HDU 2674 沙雕题
生活随笔
收集整理的這篇文章主要介紹了
数学--数论--HDU 2674 沙雕题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
WhereIsHeroFrom: Zty, what are you doing ?
Zty: I want to calculate N!..
WhereIsHeroFrom: So easy! How big N is ?
Zty: 1 <=N <=1000000000000000000000000000000000000000000000…
WhereIsHeroFrom: Oh! You must be crazy! Are you Fa Shao?
Zty: No. I haven’s finished my saying. I just said I want to calculate N! mod 2009
Hint : 0! = 1, N! = N*(N-1)!
Input
Each line will contain one integer N(0 <= N<=10^9). Process to end of file.
Output
For each case, output N! mod 2009
Sample Input
4
5
Sample Output
24
120
總結
以上是生活随笔為你收集整理的数学--数论--HDU 2674 沙雕题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: TSP(Traveling Salesm
- 下一篇: 数学--数论---欧拉筛 模板