Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5978 邓小龙 笨鸟先飞 C++ Accepted 1 MS 264 KB 447 2024-12-28 08:41:32

Tests(1/1):


Code:

#include<iostream> using namespace std; int main(){ int t; cin>>t; for(int i=1;i<=t;i++){ int n; cin>>n; int a=1,b=0; for(int j=1;j<=n;j++){ b=(a%10000+b%10000)%10000; //同余原理:b=b+a;b%10000=(b%10000+a%10000)%10000; //19998%10000=(9999%10000+9999%10000)%10000 a=(a+2)%10000; } cout<<b<<endl; } return 0; }