随笔分类 -  math

摘要:神、上帝以及老天爷Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22063 Accepted Submission(s): 9286Proble... 阅读全文
posted @ 2014-08-01 10:52 ForeverEnjoy 阅读(518) 评论(0) 推荐(0)
摘要:C - 纪念SlingShot Description 已知 F(n)=3 * F(n-1)+2 * F(n-2)+7 * F(n-3),n>=3,其中F(0)=1,F(1)=3,F(2)=5,对于给定的每个n,输出F(0)+ F(1)+ …… + F(n) mod 2009。 Input 第一行是 阅读全文
posted @ 2014-07-29 17:21 ForeverEnjoy 阅读(231) 评论(0) 推荐(0)
摘要:Given A,B,C, You should quickly calculate the result of A^B mod C. (1#include #include #include #include#includeusing namespace std;typedef __int64 ll... 阅读全文
posted @ 2014-07-28 20:02 ForeverEnjoy 阅读(614) 评论(0) 推荐(0)
摘要:1215 - Finding LCMTime Limit: 2 second(s) Memory Limit: 32 MBLCM is an abbreviation used for Least Common Multiple in Mathematics. We say LCM (a, b, c) = L if and only if L is the least integer which is divisible by a, b and c.You will be given a, b and L. You have to find c such that LCM (a, b, c) 阅读全文
posted @ 2014-03-10 09:39 ForeverEnjoy 阅读(576) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; typedef long long ll; bool is_even(ll x) { if(x%2) return 0; else return 1; } ll gcd(ll x,ll y) { if(x<y) ret 阅读全文
posted @ 2014-02-23 10:04 ForeverEnjoy 阅读(246) 评论(0) 推荐(0)