Accepted
Code
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
int main()
{
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
ll t;
cin>>t;
//t=1;//use this when no testacses
ll mod=pow(10,9)+7;
while(t--){
//Author:Aryan Prakash
ll n;
cin>>n;
ll ans=0;
ll k=sqrt(n);
for(ll i=1;i<=k;i++)ans+=(n/i);
ans*=2;
ans-=k*k;
ans-=n;
cout<<ans<<endl;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1207 D2. GCD equal Absolute Value (Hard Version)
- Contest
- Educational Round 1
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-14 16:24:35
- Judged At
- 2025-07-14 16:24:35
- Judged By
- Score
- 100
- Total Time
- 301ms
- Peak Memory
- 572.0 KiB