Sum of N | Codechef Starters 139 | Very Easy Explaination
ฝัง
- เผยแพร่เมื่อ 8 ก.ย. 2024
- #codechefsolutiontoday
#CodeChef Starters 139
#dsa
#codechefsolution 139
#c++
#coding
#programming
#competitive programming
#software developer
#software engineer
#interview preparation
#interview experience
#dsa
#139
#include
using namespace std;
#define int long long
bool prime[1000001];
int prefixSum[1000001]={0};
void SieveOfEratosthenes()
{
memset(prime, true, sizeof(prime));
int e=1000001;
for (int p = 2; p * p
searching for this type of explanation and u give it . Great work , keep doing it
Great Explanation!
subscribed plz keep uploading
zarur bhai
Can you tell me the time complexity of " Sum of N" Implementation in your code. Bcz I wrote same code almost and I also used sieve of Eratosthenes. But I got TLE. My code time is Klog log K + root(K) + atmost K for loop which won't go completely most of times.
TC is correct but are you pre-computing the prefixSumOfNPrimes?
How should I practice to solve these type of questions during the time control. If you can suggest me.
Keep grinding. Practice is the only key . Solve questions above your rating like 200-300+
Wo first permutations wala question kese hoga
Talking about Maximum distance permutations? This video is already uploaded on my channel