2 条题解
-
0
-
0
#include <bits/stdc++.h> #define LL long long using namespace std; const LL P = 10007; LL qpow(LL a, LL b) { int res = 1; for (; b; b >>= 1, a = a * a % P) if (b & 1) res = (res * a) % P; return res; } int main() { int T; scanf("%d", &T); while (T--) { LL n; scanf("%lld", &n); LL ans = (qpow(4LL, n) + qpow(2LL, n + 1)) % P * qpow(4LL, P - 2) % P; printf("%lld\n", ans); } return 0; }
- 1
信息
- ID
- 616
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 77
- 已通过
- 35
- 上传者