话说那个TLE
以下列举了复杂度
#include
#include
int main() {
__int64 sum1=1,sum2=1;
for(int i=1; i<=30; i++) {
sum1*=3;
sum2*=2;
printf("%2d\t%-12I64d%-12I64d\n",i,sum2,sum1);...
分类:
其他好文 时间:
2014-09-02 12:30:24
阅读次数:
215
必须MARK下:任何时候都要保持清醒头脑,不要被题目绕了。。其实就是求最小公倍数。#include #include #include using namespace std;__int64 v[20];__int64 gcd(__int64 a,__int64 b){ if(b==0) retur...
分类:
其他好文 时间:
2014-09-01 12:32:43
阅读次数:
204
//回宿舍去了,明天做点难一点的题,今天做的都很水,感觉。没意思。#include #include using namespace std;const __int64 MOD=10; __int64 Power(__int64 a,__int64 b,__int64 m){ a%=m; __...
分类:
其他好文 时间:
2014-08-30 23:00:30
阅读次数:
197
找规律吧。可以快速幂模#include #include using namespace std;__int64 Power(__int64 a,__int64 b,__int64 k){ __int64 ans=1; a%=k; while(b){ if(b&1){ ans=ans*a%k;...
分类:
其他好文 时间:
2014-08-30 22:54:50
阅读次数:
264
#include
#include
#include
#include
using namespace std;
typedef __int64 LL;
const int Times = 20;
LL factor[100], l;
LL gcd(LL a, LL b)
{
return b ? gcd(b, a%b):a;
}
LL add_mod(LL a, LL b, LL n)...
分类:
其他好文 时间:
2014-08-30 20:28:20
阅读次数:
285
/*
解题思路:中国剩余定理,另外注意数据的类型,要使用__int64位的
解题人:lingnichong
解题时间:2014-08-30 06:56:35
解题体会:简单题
*/
Prepared for New Acmer
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768...
分类:
其他好文 时间:
2014-08-30 07:42:09
阅读次数:
212
线性同余方程组,模板了。但要注意读完数据才跳出循环啊#include #include #include #include using namespace std;void exgcd(__int64 a,__int64 b,__int64 &d,__int64 &xx,__int64 &yy){ ...
分类:
其他好文 时间:
2014-08-29 17:37:38
阅读次数:
162
- (IBAction)clip { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // 1.捕捉 UIImage *newI...
分类:
移动开发 时间:
2014-08-27 21:45:38
阅读次数:
162
A:
这道题目还是很简单的,做过很多遍了,类似于切割木板的问题。
把所有的数放在一个优先队列里,弹出两个最大的,然后合并,把结果放进去。依次进行。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define LL __int64
#define IN...
分类:
其他好文 时间:
2014-08-27 13:05:07
阅读次数:
222
名称说明Abs(Decimal)返回Decimal数字的绝对值。Abs(Double)返回双精度浮点数字的绝对值。Abs(Int16)返回 16 位有符号整数的绝对值。Abs(Int32)返回 32 位有符号整数的绝对值。Abs(Int64)返回 64 位有符号整数的绝对值。Abs(SByte)返回...
分类:
其他好文 时间:
2014-08-26 21:25:36
阅读次数:
878