1 kyu

Express number as sum of four squares

66 of 108dolamroth

Description:

Recently you had a quarrel with your math teacher. Not only that nerd demands knowledge of all the theorems, but he turned to be an constructivist devotee! After you recited by heart Lagranges theorem of sum of four squares, he now demands a computer program to obtain such a decomposition, so that to see that you really understand a topic. What a downer!

You remember well the theorem. Any positive integer can be decomposed into a sum of four squares of integers. Seems not too hard... But after a quarrel, your teacher wants blood. Apparently he will test your program on extremely huge numbers... And your program better finished working before the break - you don't want to get F, do you?

Tip: random tests feature 20 numbers as high as 2^128 and 20 number as high as 2^1024.

Performance
Algorithms
Mathematics

Stats:

CreatedAug 21, 2022
PublishedAug 21, 2022
Warriors Trained8525
Total Skips497
Total Code Submissions7125
Total Times Completed108
Python Completions66
JavaScript Completions37
Java Completions14
Racket Completions3
Total Stars255
% of votes with a positive feedback rating100% of 34
Total "Very Satisfied" Votes34
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes0
Total Rank Assessments3
Average Assessed Rank
2 kyu
Highest Assessed Rank
1 kyu
Lowest Assessed Rank
4 kyu
Ad
Contributors
  • dolamroth Avatar
  • Bubbler Avatar
Ad