主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
RingoCrystal
2025年2月10日 11:06
递推数列 题解:dp
P1171
回复 0
|
赞 2
|
浏览 159
#include <bits/stdc++.h> using namespace std; int main() { int a0,a1,p,q,k; while(cin>>a0>>a1>>p>>q>>k){ int a[k+1]; a[0]=a0;a[1]=a1; for(int i=2;i<=k;i++){ a[i]=(p*a[i-1]+q*a[i-2])%10000; } cout<<a[k]&...
孙某人
2024年3月19日 19:08
递推数列 题解:怎么不告诉我是多组数据啊,好伤心啊
P1171
回复 0
|
赞 0
|
浏览 612
#include <iostream> #include <string.h> using namespace std; int main(){ int a0,a1,p,q,k; while(cin >> a0 >> a1 >> p >> q >>k){ int a[10005]; a[0]=a0; a[1]=a1; for(int i=2;i<10005;i++) a[i]=(a[i-1]*p+a[i-2]*q)%10000; cout <&...
不知道谁
2023年2月1日 16:11
矩阵乘法(快速幂)&直接递推
P1171
回复 0
|
赞 2
|
浏览 3.2k
1.直接递推 #include <bits/stdc++.h> using namespace std; int main() { int a0,a1,p,q,k; int i; while(cin>>a0>>a1>>p>>q>>k) { int a[k+1]; a[0]=a0; a[1]=a1; for(i=2;i<k+1;i++) a[i]=(p*a[i-1]+q*a[i-2])%100...
chenziyi
2020年4月25日 11:24
请问一下递归的错误原因
P1171
回复 0
|
赞 0
|
浏览 7.3k
中间加不加%10000都是wrong.. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <string> #include <vector> using namespace std; typedef long long ll; ll a0,a1,p,q,k; ll dp[1000]; ll ditui(int k){ if(k==0)return...
题目
递推数列
题解数量
4
发布题解
在线答疑
热门题解
1
矩阵乘法(快速幂)&直接递推
2
递推数列 题解:dp
3
请问一下递归的错误原因
4
递推数列 题解:怎么不告诉我是多组数据啊,好伤心啊