题库 信息学奥赛题库 题目列表 阅读程序写结果:#include <iostream> using na...
填空题

阅读程序写结果:

#include <iostream> using namespace std; const int c=2009; int main() { int n,p,s,i,j,t; cin >> n >> p; s=0;t=1; for(i=1;i<=n;i++) { t=t*p%c; for(j=1;j<=i;j++) s=(s+t)%c; } cout << s << endl; return 0; }

输入:11 2

题目信息
2009年 初赛
-
正确率
0
评论
60
点击