C++ Basic Prefix and Syntax Problems (November 23, 2025)

C++ Basic Prefix and Syntax Problems (November 23, 2025)

Problem Description: The Three-Color Wall of Little Code BrotherVerify whether the prefix sum array construction is successfulThe code is as follows: #include <bits/stdc++.h> using namespace std;const int N = 1007;int n,m;string s;int w[N] = {0},b[N] = {0},r[N] = {0}; int money(char c){int ans = 0;//WRWRWfor(int i=0;i<s.size();i++){if(s[i]!=c){ ans++; } }return ans;} int main(){ cin >> n … Read more

Detailed Explanation of GESP C++ Level 3 Problem: Balanced Sequence

Today we will learn about the GESP C++ Level 3 problem titled “Balanced Sequence”. This problem tests the concept of prefix sums and array traversal techniques, making it a classic foundational algorithm problem. 1. Problem Description Little Yang has a sequence a containing n positive integers. He considers a sequence to be balanced if and … Read more

Analysis of GESP C++ Level 4 Exam Questions – Strategic Deployment (luogu-B4415)

GESP C++ Level 4 exam questions from September 2025, focusing on two-dimensional arrays, difficulty ⭐⭐★☆☆. GESP Level 1 Practice Questions List GESP Level 1 Exam Questions List GESP Level 2 Practice Questions List GESP Level 2 Exam Questions List GESP Level 3 Practice Questions List GESP Level 3 Exam Questions List GESP Level 4 Practice … Read more

GESP C++ Level 4 Real Questions (Sorting, Prefix Sum, Sliding Window) [202406] Treasure Box (luogu-B4006)

GESP C++ Level 4 Real Questions (Sorting, Prefix Sum, Sliding Window) [202406] Treasure Box (luogu-B4006)

GESP C++ Level 4 real questions for June 2024. This problem mainly tests the concepts of sorting, prefix sums, and sliding windows. The brute force difficulty is not high, but the sliding window requires some thought, with an overall difficulty rating of ⭐⭐★☆☆. This problem is rated as <span>Popular-</span>. GESP Level 1 Practice Questions List … Read more

GESP C++ Level 4 Real Questions (Multidimensional Arrays, Prefix Sum Algorithm) luogu-B4005 [GESP202406 Level 4] Black and White Squares

GESP C++ Level 4 Real Questions (Multidimensional Arrays, Prefix Sum Algorithm) luogu-B4005 [GESP202406 Level 4] Black and White Squares

GESP C++ Level 4 real questions for June 2024. This problem mainly tests two-dimensional arrays, multiple loop operations, and even the prefix sum concept. The brute force difficulty is not high, but optimizing with prefix sums requires some thought, with an overall difficulty rating of ⭐⭐★☆☆. This problem is rated as<span>Popular-</span>. GESP Level 1 Practice … Read more