您的位置:首页 > 其它

FFT与多项式、生成函数题目泛做

2016-03-21 21:32 211 查看
题目1 COGS 很强的乘法问题

高精度乘法用FFT加速

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <algorithm>
#include <cctype>

using namespace std;
const int N = 500 + 5;
const int mod = 10007;
typedef long long ll;

ll n;

inline ll read() {
ll x = 0;
char c = getchar();
while(!isdigit(c)) c = getchar();
while(isdigit(c)) {
x = x * 10 + c - '0';
x %= mod;
c = getchar();
}
return x;
}

int main() {
n = read();
n = n * (n + 1) * (n + 2);
n /= 6;
n %= mod;
printf("%lld\n", n);
return 0;
}


3028
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: