Accepted
Code
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef int 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
- P1206 D1. GCD equal Absolute Value (Easy Version)
- Contest
- Educational Round 1
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-14 16:46:58
- Judged At
- 2025-07-14 16:46:58
- Judged By
- Score
- 100
- Total Time
- 441ms
- Peak Memory
- 1.367 MiB