HDU-2520 我是菜鸟,我怕谁 (水)
题目链接
题意:匀加速直线运动,
由于 V = V0 + A*T
所以 A = 2;
又由 S = VO*T + 0.5*A*T*T;
所 S = T*T
//公式 S = T*T
#include<cstdio>
using namespace std;
int main()
{
int n;
__int64 t;
scanf("%d%*c",&n);
while(n--)
{
scanf("%I64d",&t);
printf("%I64d\n",t*t%10000);
}
return 0;
}
//题意模拟
#include"cstdio"
using namespace std;
int main(){
int v,i,s,t,n;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
s = 1;
v = 1;
for(i=2; i<=n; i++){
v += 2;
s += v;
}
printf("%d\n",s%10000);
}
return 0;
}