题目大意、题解:http://wyfcyx.is-programmer.com/posts/76787.html
CODE:
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #define MAX 510 #define MO 10007 using namespace std; char s[MAX]; int main() { scanf("%s",s); int length = strlen(s); int re = 0; for(int i = 0; i < length; ++i) re *= 10,re += s[i] - '0',re %= MO; re = re * (re + 1) % MO * (re + 2) % MO; re = re * 1668 % MO; cout << re << endl; return 0; }
原文地址:http://blog.csdn.net/jiangyuze831/article/details/42868935