Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 1731    Accepted Submission(s): 656


Problem Description
Let us define a sequence as below

1=A
2=B
⌋


  Your job is simple, for each task, you should output 7
.
 

 

Input
The first line has only one integer 9
 

 

Sample Input
2
3 3 2 1 3 5
3 2 2 2 1 4
 

 

Sample Output
36
24
 

 

Source
 
 
HDU-6395 多校7 Sequence(除法分块+矩阵快速幂)
 
cin>>n;
ll ans = 0;
for(ll l = 1,r;l <= n;l = r + 1){
     r = n / (n / l);
     ans += (r - l + 1) * (n / l);
}
cout<<ans<<endl;
除法分块模板

 

相关文章:

  • 2022-02-14
  • 2022-12-23
  • 2021-05-03
  • 2021-11-26
  • 2021-05-26
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
猜你喜欢
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案