Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
105549 胡海峰老师 笨鸟先飞 C++ Accepted 1 MS 272 KB 307 2025-01-13 20:56:35

Tests(1/1):


Code:

#include <iostream> using namespace std; int main(){ int t; long long n,dis,j,speed; cin>>t; while(t--) { cin>>n; speed =1 ; dis = speed; for(j=1;j<=n-1;j++) { speed = speed +2; dis = dis + speed; } cout<< dis%10000<<endl; } return 0; }