#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <set>
#include <ctime>
#include <cstdlib>
using namespace std;
#define inf 0x3f3f3f3f
#define N 1020
#define LL long long
#define mod 1000000009
int n;
void add(int &x, int y) {
x += y;
if(x >= mod) x -= mod;
}
int main() {
scanf("%d", &n);
int ans = 0;
if(n == 2) {
puts("10");
return 0;
}
ans += 6;
int tmp = 1, mul = 2, res = 4;
for(int i = 6; i <= n; i += 2) {
add(mul, mul);
add(tmp, mul);
res = 1LL * res * tmp % mod;
add(ans, res);
}
ans = 1LL * ans * ans * 2 % mod;
ans += 2;
if(ans >= mod) ans -= mod;
printf("%d\n", ans);
return 0;
}
Codeforces 15E Trangles (计数)
最新推荐文章于 2021-01-14 21:46:36 发布