7 kyu
Asperand pixel counting
493 of 942artiekra
Description:
Description
You can paint an asperand by pixels in three steps:
- First you paint the inner square, with a side of
k
. - Then you need to paint one pixel, that's laying diagonally relative to the inner square that you just painted ( the bottom-right corner of the inner square is touching the top-left corner of the pixel ). Let's call it the "bridge".
- Finally, you will need to paint the outer shape, connected diagonally to the "bridge" ( see the picture for more information ).
Here are some examples of this:
Your task is to find the number of pixels that need to be painted, for different k
:
k = 1 => 11
k = 2 => 18
k = 3 => 26
k = 4 => 34
# Limitations are 1 ≤ k ≤ 1e9
The idea for this kata was taken from the Ukrainian Informatics Olympiad 2023.
Algebra
Puzzles
Similar Kata:
Stats:
Created | Jan 28, 2023 |
Published | Jan 28, 2023 |
Warriors Trained | 2007 |
Total Skips | 37 |
Total Code Submissions | 3056 |
Total Times Completed | 942 |
Python Completions | 493 |
JavaScript Completions | 387 |
Haskell Completions | 36 |
λ Calculus Completions | 9 |
C Completions | 77 |
Scala Completions | 12 |
Total Stars | 19 |
% of votes with a positive feedback rating | 94% of 134 |
Total "Very Satisfied" Votes | 117 |
Total "Somewhat Satisfied" Votes | 17 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 10 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |