Codeforces Jzzhu and Sequences(圆形截面)
# include <stdio.h>
int f[10];
int main()
{
int x,y,n,j;
while(~scanf("%d%d%d",&x,&y,&n))
{ f[1]=x;
f[2]=y;
for(j=3;j<=6;j++)
{
f[j]=f[j-1]-f[j-2];
}
n%=6;
if(n==0)
n=6;
if(f[n]>=0)
printf("%d\n",f[n]%1000000007);
else
while(f[n]<0)//注意负数取模 然后就没有然后了~~~~~
f[n]+=1000000007;
printf("%d\n",f[n]%1000000007);
}
return 0;
}
版权声明:本文博客原创文章,博客,未经同意,不得转载。
Codeforces Jzzhu and Sequences(圆形截面)的更多相关文章
- CodeForces 450B Jzzhu and Sequences (矩阵优化)
CodeForces 450B Jzzhu and Sequences (矩阵优化) Description Jzzhu has invented a kind of sequences, they ...
- Codeforces Round #257(Div. 2) B. Jzzhu and Sequences(矩阵高速幂)
题目链接:http://codeforces.com/problemset/problem/450/B B. Jzzhu and Sequences time limit per test 1 sec ...
- Codeforces Round #257 (Div. 2 ) B. Jzzhu and Sequences
B. Jzzhu and Sequences time limit per test 1 second memory limit per test 256 megabytes input standa ...
- CodeForces - 450B Jzzhu and Sequences —— 斐波那契数、矩阵快速幂
题目链接:https://vjudge.net/problem/CodeForces-450B B. Jzzhu and Sequences time limit per test 1 second ...
- codeforces 450B B. Jzzhu and Sequences(矩阵快速幂)
题目链接: B. Jzzhu and Sequences time limit per test 1 second memory limit per test 256 megabytes input ...
- Codeforces450 B. Jzzhu and Sequences
B. Jzzhu and Sequences time limit per test 1 second memory limit per test 256 megabytes input standa ...
- CF450B Jzzhu and Sequences(矩阵加速)
CF450B Jzzhu and Sequences 大佬留言:这.这.不就是矩乘的模板吗,切掉它!! You are given xx and yy , please calculate $f_{n ...
- 数学 找规律 Jzzhu and Sequences
A - Jzzhu and Sequences Jzzhu has invented a kind of sequences, they meet the following property: ...
- Codeforces Round #257 (Div. 2) B Jzzhu and Sequences
Jzzhu has invented a kind of sequences, they meet the following property: You are given x and y, ple ...
随机推荐
- RobotFramework 自定义Library
RobotFramework 主要使用Python,这里简单自定义Library,以扩充RobotFramework的功能 新建一个python类,自定义需要的方法 例如: 保存成TestLibrar ...
- win32 sdk绘制ListBox控件
1>产生: // HWND CreateLB(HWND parentWnd) { HWND hListBox=0; hListBox = CreateWindow("LISTBOX&q ...
- 与众不同 windows phone (10) - Push Notification(推送通知)之推送 Tile 通知, 推送自定义信息
原文:与众不同 windows phone (10) - Push Notification(推送通知)之推送 Tile 通知, 推送自定义信息 [索引页][源码下载] 与众不同 windows ph ...
- Java线程并发中常见的锁--自旋锁 偏向锁
随着互联网的蓬勃发展,越来越多的互联网企业面临着用户量膨胀而带来的并发安全问题.本文着重介绍了在java并发中常见的几种锁机制. 1.偏向锁 偏向锁是JDK1.6提出来的一种锁优化的机制.其核心的思想 ...
- grep、sed、awk、perl、js、vim等对正则表达式的支持的差别
grep.sed.awk.perl等对正则表达式的支持的差别 grep 2.5.1 egrep 2.5.1 sed 3.02 sed 4.07 awk 3.1.1 perl 5.8.0 vim 6.1 ...
- Android studio导入第三方类库
1.开发过程中想要导入第三方类库和Eclipse也是有差别的,我们导入SlidingMenu这个类库,从github上下载下来解压到项目目录下. 2.然后我们重启我们的android studio就会 ...
- Xaml在string(串)定义常量和处理空间
(1)基本使用方法 xaml中能够实例化各种对象,比方在ResourceDictionary中定义字符串常量: <ResourceDictionary xmlns="http://sc ...
- hprose rpc使用实例(同时有Java和Delphi客户端的例子)
php server <?php require_once('src/Hprose.php'); function hello($name) { echo "Hello $name!& ...
- [置顶] 大量相关gis资源网盘打包下载
详细请下载附件 所有资源下载(网盘下载): http://laoheitan.bego.cc arcgis教程: http://www.bego.cc/file/23322579 ENVI教程: ht ...
- Android 增量更新实例(Smart App Updates)
原地址:http://my.oschina.net/liucundong/blog/160436 官方说明 实现原理 实现 (1)生成差异包 (2)使用旧apk+差异包,在客户端合成新apk 注意事项 ...