We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #173: Using up to one million tiles how many different "hollow" square laminae can be formed?
  4. Discussions

Project Euler #173: Using up to one million tiles how many different "hollow" square laminae can be formed?

Problem
Submissions
Leaderboard
Discussions

    You are viewing a single comment's thread. Return to all comments →

  • Anonympous
    4 years ago+ 0 comments

    simple c++ solution::

    #include<bits/stdc++.h>
    using namespace std;
    
    int main() 
    {
        long n;
        cin>>n;
        long long tiles=n/4;
        long long  k=int(sqrt(tiles));
        long long sum=0;
        for(int i=1;i<=k;i++)
        {
            sum=sum+(tiles/i-i);
            
        }
        cout<<sum;
        return 0;
    }
    
    -1|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy