⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 problem 2105.htm

📁 zju_acm的部分题目! 都是些基本题目!大家看看
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://acm.zju.edu.cn/show_problem.php?pid=2105 -->
<HTML><HEAD><TITLE>Problem 2105</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3157" name=GENERATOR></HEAD>
<BODY>
<CENTER><IMG src="Problem 2105.files/logo.gif" align=center></IMG></CENTER>
<HR>

<CENTER><FONT color=blue size=+2>Number Sequence</FONT></CENTER>
<HR>

<CENTER><FONT color=green>Time limit:</FONT> 1 Seconds&nbsp;&nbsp; <FONT 
color=green>Memory limit: </FONT>32768K&nbsp;&nbsp; </FONT><BR><FONT 
color=green>Total Submit:</FONT> 5561&nbsp;&nbsp; <FONT color=green>Accepted 
Submit:</FONT> 1194&nbsp;&nbsp; </CENTER>
<HR>

<P>A number sequence is defined as follows:<BR><BR>f(1) = 1, f(2) = 1, f(n) = (A 
* f(n - 1) + B * f(n - 2)) mod 7.<BR><BR>Given A, B, and n, you are to calculate 
the value of f(n).</P>
<P><BR><B>Input</B><BR><BR>The input consists of multiple test cases. Each test 
case contains 3 integers A, B and n on a single line (1 &lt;= A, B &lt;= 1000, 1 
&lt;= n &lt;= 100,000,000). Three zeros signal the end of input and this test 
case is not to be processed.</P>
<P><BR><B>Output</B><BR><BR>For each test case, print the value of f(n) on a 
single line. </P>
<P><BR><B>Sample Input</B><BR><BR>1 1 3<BR>1 2 10<BR>0 0 0</P>
<P><BR><B>Sample Output</B><BR><BR>2<BR>5</P>
<P><BR><B>Author: </B><I>CHEN, Shunbao</I><BR></P>
<HR>
<FONT color=green size=+1>Problem Source: </FONT><I>Zhejiang Provincial 
Programming Contest 2004</I>
<HR>
 
<CENTER><A href="http://acm.zju.edu.cn/submit.php?pid=2105">Submit</A> 
&nbsp;&nbsp;<A href="http://acm.zju.edu.cn/list_problem.php?vol=12">Back</A> 
&nbsp;&nbsp;<A 
href="http://acm.zju.edu.cn/problem_status.php?pid=2105">Status</A> </CENTER>
<HR>

<CENTER>
<TABLE width="100%" border=0>
  <TBODY>
  <TR>
    <TD align=right width="65%"><A href="http://acm.zju.edu.cn/"><FONT 
      color=red>Zhejiang University Online Judge</FONT></A> <A 
      href="http://acm.zju.edu.cn/"><FONT color=red>V1.0</FONT></A></TD>
    <TD align=right width="35%"><A href="http://www.zzhang.cn/"><FONT 
      color=#ffffff 
size=-3>Book</FONT></A></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -