传送门:http://codeforces.com/problemset/problem/15/E

【题解】

 # include <bits/stdc++.h>
using namespace std; typedef long long ll; const int mod = 1e9 + ; int main() {
int n;
cin >> n;
n >>= ; int t = , tem, res = , pwr = ;
for (int i=; i<=n; ++i) {
pwr <<= ;
if(pwr >= mod) pwr -= mod;
tem = pwr - ;
if(tem <= mod) tem += mod;
t = 1ll * t * tem % mod;
res = res + t;
if(res >= mod) res -= mod;
} res = 4ll * res % mod; int ans = 8ll * res % mod + ;
if(ans >= mod) ans -= mod;
ans = ans + 2ll * res * res % mod;
if(ans >= mod) ans -= mod; cout << ans; return ;
}

codeforces15E Triangles的更多相关文章

  1. Count the number of possible triangles

    From: http://www.geeksforgeeks.org/find-number-of-triangles-possible/ Given an unsorted array of pos ...

  2. [ACM_搜索] Triangles(POJ1471,简单搜索,注意细节)

    Description It is always very nice to have little brothers or sisters. You can tease them, lock them ...

  3. acdream.Triangles(数学推导)

    Triangles Time Limit:1000MS     Memory Limit:64000KB     64bit IO Format:%lld & %llu Submit Stat ...

  4. UVA 12651 Triangles

    You will be given N points on a circle. You must write a program to determine how many distinctequil ...

  5. Codeforces Gym 100015F Fighting for Triangles 状压DP

    Fighting for Triangles 题目连接: http://codeforces.com/gym/100015/attachments Description Andy and Ralph ...

  6. Codeforces Round #309 (Div. 1) C. Love Triangles dfs

    C. Love Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/553/pro ...

  7. Codeforces Round #308 (Div. 2) D. Vanya and Triangles 水题

    D. Vanya and Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55 ...

  8. Project Euler 94:Almost equilateral triangles 几乎等边的三角形

    Almost equilateral triangles It is easily proved that no equilateral triangle exists with integral l ...

  9. Project Euler 91:Right triangles with integer coordinates 格点直角三角形

    Right triangles with integer coordinates The points P (x1, y1) and Q (x2, y2) are plotted at integer ...

随机推荐

  1. Beta阶段团队项目开发篇章1

    例会时间:2016.12.1 例会照片: 个人工作: 任务分配: 组员 任务内容 李文涛 编写并发布调查问卷 姬索肇 审核并传播调查问卷 韩慧敏 审核并传播调查问卷 任务截止时间 2016.12.4 ...

  2. <构建之法>前三章读后感—软件工程

    本教材不同于其他教材一贯的理知识直接灌溉,而是以对话形式向我们传授知识的,以使我们更好地理解知识点,更加清晰明确. 第一章 第一章的概述中,书本以多种方式,形象生动地向我们阐述了软件工程的内容,也让我 ...

  3. 在Google Chrome中快速解除网页屏蔽鼠标右键、复制等限制

    第一步,将书签栏设置为显示状态!   第二步,添加新书签——>在标签栏点击右键,选择“添加网页”. 第三步,设置新书签的内容. 1.起名.这个凭个人爱好吧 2.网址栏输入: javascript ...

  4. [转帖] windows server 不同版本说明

    Windows Server 2016与Windows Server Current Version区别比较  http://365vcloud.net/2018/04/13/windows-serv ...

  5. 关于2013年1月21日的DNS故障分析文章

    首页 资讯 小组 资源 注册 登录       首页 最新文章 业界 开发 IT技术 设计 创业 IT职场 访谈 在国外 经典回顾 更多 > - 导航条 - 首页 最新文章 业界 - Googl ...

  6. JS贪吃蛇小游戏

    效果图展示: 具体实现代码如下: (1)html部分 !DOCTYPE html> <html> <head> <meta charset="utf-8& ...

  7. P3223 [HNOI2012]排队

    题目描述 某中学有 n 名男同学,m 名女同学和两名老师要排队参加体检.他们排成一条直线,并且任意两名女同学不能相邻,两名老师也不能相邻,那么一共有多少种排法呢?(注意:任意两个人都是不同的) 输入输 ...

  8. Day24--Part2-伪Ajax(iframe)

    参考:http://www.pythonsite.com/ 赵凡同学的博客,每一份努力都值得期许! 867468837 Ajax操作---伪Ajax (iframe) 一,基于iframe实现伪Aja ...

  9. oracle +plsql装完省略号不能点

    1.如图 2.复制 TNS 服务名 3.复制到 登录框的 Database ,输入用户名密码,点OK..可以进去了,省略号变成可点击状态

  10. 【BZOJ1041】圆上的整点(数论)

    [BZOJ1041]圆上的整点(数论) 题面 BZOJ 洛谷 题解 好神仙的题目啊. 安利一个视频,大概是第\(7\)到\(19\)分钟的样子 因为要质因数分解,所以复习了一下\(Pollard\_r ...