You are viewing a single comment's thread. Return to all 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; }
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #173: Using up to one million tiles how many different "hollow" square laminae can be formed?
You are viewing a single comment's thread. Return to all comments →
simple c++ solution::