ITGUY00 - Editorial

Problem: Contest Page | CodeChef

DIFFICULTY:

EASY.

PROBLEM:

The chef is having one array of natural numbers. Cheffina challenges chef that find the sum of weights all the natural numbers present in the array, but the main problem is that all numbers have not original weights. After every 6 natural numbers weight is set to 1 as weight increases by 1 after that. (i.e. weight of 1 is 1, weight of 2 is 2 but the weight of 7 is 1 and weight of 8 is 2 and so on…). Help the chef to find the sum.

Program:

#include<bits/stdc++.h> 
using namespace std; 
 
int main() 
{ 
	ios_base::sync_with_stdio(false);
   	cin.tie(NULL);
   	cout.tie(NULL);
   	int t,x,n;
   	cin>>t;
   	while(t--){
   		cin>>n;
   		long long ans=0;
   		for(int i=0;i<n;i++){
   			cin>>x;
   			if(x%6==0)ans+=6;
   			else ans+=x%6;
   		}
   		cout<<ans<<endl;
   	}
}
1 Like

Could you tell why were so many solutions getting TLE while all of them were perfectly correct?

1 Like

Hello,
Size of the file was large.
As per the constraints, it was presumed that coder must use fast i/o techniques.

Thanks and Regards

Nice Contest , Can you make Problems available for upsolving.

1 Like

@references, I haven’t received laddus for previous contest (push back ). Any idea about it? Also will the laddus be given for this contest?

1 Like

It takes 6 days for laddus to be delivered in these unrated short contests.

1 Like

Till which rank you get laddus in Unrated rounds like these?

You need to contact Admin or Neha Kakkoth for that. Mail I’d: neha@codechef.com
Thanks and regards.

1 Like

Sure…
It will take some time.

1 Like

I think only Top 3

1 Like

Okk Thanks

Okkk They are available now , Thanks