EMBEDDED CHESSBOARDS
How many chessboards can be found in the painting? I was wondering.
EXPLANATION CODE:
1) This code reads a sequence of Painting objects from standard input, which contain the row, column, and color (either 0 or 1, representing black and white, respectively) of a square in a checkerboard. For each Painting, the code outputs the number of rectangles of size 8x8 that can be created on the checkerboard, using the top-left square of the rectangle as the square indicated by the Painting object, while ensuring that the top-left square is not a white square (if it were, the rectangle would not be aligned with the checkerboard's grid).
2) The code defines a Painting struct with three fields: row (an integer indicating the row of the square), col (an integer indicating the column of the square), and isWhite (an integer indicating whether the square is white, with 0 indicating black and 1 indicating white).
3) The main function begins by ignoring any input up to the end of the current line. It then enters a loop that reads Painting objects from std::cin until there is no more input, and for each object, it outputs the number of 8x8 rectangles that can be created on the checkerboard with the top-left square being the square indicated by the Painting object, as described above. The output is separated by newline characters.
#codingame #coding #game #programming #easy #difficulty #reading #arithmetic #cplusplus #cplusplusprogramming #learntocode #tutorial #education #problemsolving #algorithmic #asmr #asmrtyping #embedded #chessboard
Other Videos By One Person Studio
2023-02-22 | AMONG US XIX #shorts #art #drawing |
2023-02-22 | AMONG US XVIII #shorts #art #drawing |
2023-02-21 | PYTHON TURTLE: FACEBOOK |
2023-02-21 | TAMAKI AMAJIKI #shorts #art #drawing |
2023-02-21 | BARBARIAN #shorts #art #drawing |
2023-02-21 | ARE THEY OPPOSITE? |
2023-02-21 | SKETCHBOOK TOUR PART LXXXV #shorts #art #drawing |
2023-02-20 | SHION MADARAME #shorts #art #drawing |
2023-02-20 | THE MYSTIC RECTANGLE |
2023-02-20 | L #shorts #art #drawing |
2023-02-20 | EMBEDDED CHESSBOARDS |
2023-02-19 | BOSTON CRIME |
2023-02-18 | LATE BLOOMER'S LOVE STORY: A JOURNEY OF LOVE AT FIRST SIGHT FINAL PART |
2023-02-18 | HARLEY QUINN #shorts #art #drawing |
2023-02-18 | NOBITA #shorts #art #drawing |
2023-02-18 | LATE BLOOMER'S LOVE STORY: A JOURNEY OF LOVE AT FIRST SIGHT PART III |
2023-02-17 | BEERUS #shorts #art #drawing |
2023-02-17 | TAO PAI PAI #shorts #art #drawing |
2023-02-17 | CHOTA BHEEM #shorts #art #drawing |
2023-02-17 | LATE BLOOMER'S LOVE STORY: A JOURNEY OF LOVE AT FIRST SIGHT PART II |
2023-02-16 | BEN 10 #shorts #art #drawing |