22. 括号生成/C++

在这里插入图片描述

class Solution {
public:
    vector<string> res;
    vector<string> generateParenthesis(int n) {
        generate("",0,0,n);
        return res;
    }
    void generate(string str, int left, int right, int max){
        if(str.size()==2*max){
            res.push_back(str);
            return;
        }
        if(left<max) generate(str+"(",left+1,right,max);
        if(right<left) generate(str+")",left,right+1,max);
    }
};
22:42:47 **** Incremental Build of configuration Debug for project PID1 **** make -j16 all arm-none-eabi-gcc "../Core/Src/gpio.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/gpio.d" -MT"Core/Src/gpio.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/gpio.o" arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/main.o" arm-none-eabi-gcc "../Core/Src/motor.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/motor.d" -MT"Core/Src/motor.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/motor.o" arm-none-eabi-gcc "../Core/Src/oled.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/oled.d" -MT"Core/Src/oled.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/oled.o" arm-none-eabi-gcc "../Core/Src/stm32f1xx_hal_msp.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/stm32f1xx_hal_msp.d" -MT"Core/Src/stm32f1xx_hal_msp.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/stm32f1xx_hal_msp.o" arm-none-eabi-gcc "../Core/Src/stm32f1xx_it.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/stm32f1xx_it.d" -MT"Core/Src/stm32f1xx_it.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/stm32f1xx_it.o" ../Core/Src/main.c:34:1: error: unknown type name 'Motor_Driver' 34 | Motor_Driver motor; | ^~~~~~~~~~~~ ../Core/Src/main.c:35:1: error: unknown type name 'Encoder' 35 | Encoder encoder; | ^~~~~~~ ../Core/Src/main.c:36:1: error: unknown type name 'PID_Controller' 36 | PID_Controller pid; | ^~~~~~~~~~~~~~ ../Core/Src/main.c: In function 'main': ../Core/Src/main.c:106:3: warning: implicit declaration of function 'Motor_Init' [-Wimplicit-function-declaration] 106 | Motor_Init(&motor, &htim1, TIM_CHANNEL_1, | ^~~~~~~~~~ ../Core/Src/main.c:107:14: error: 'MOTOR_AIN1_Port' undeclared (first use in this function) 107 | MOTOR_AIN1_Port, MOTOR_AIN1_Pin, | ^~~~~~~~~~~~~~~ ../Core/Src/main.c:107:14: note: each undeclared identifier is reported only once for each function it appears in ../Core/Src/main.c:107:31: error: 'MOTOR_AIN1_Pin' undeclared (first use in this function) 107 | MOTOR_AIN1_Port, MOTOR_AIN1_Pin, | ^~~~~~~~~~~~~~ ../Core/Src/main.c:108:14: error: 'MOTOR_AIN2_Port' undeclared (first use in this function) 108 | MOTOR_AIN2_Port, MOTOR_AIN2_Pin, | ^~~~~~~~~~~~~~~ ../Core/Src/main.c:108:31: error: 'MOTOR_AIN2_Pin' undeclared (first use in this function) 108 | MOTOR_AIN2_Port, MOTOR_AIN2_Pin, | ^~~~~~~~~~~~~~ ../Core/Src/main.c:109:14: error: 'MOTOR_STBY_Port' undeclared (first use in this function) 109 | MOTOR_STBY_Port, MOTOR_STBY_Pin); | ^~~~~~~~~~~~~~~ ../Core/Src/main.c:109:31: error: 'MOTOR_STBY_Pin' undeclared (first use in this function) 109 | MOTOR_STBY_Port, MOTOR_STBY_Pin); | ^~~~~~~~~~~~~~ ../Core/Src/main.c:110:3: warning: implicit declaration of function 'Encoder_Init' [-Wimplicit-function-declaration] 110 | Encoder_Init(&encoder, &htim2); | ^~~~~~~~~~~~ ../Core/Src/main.c:111:3: warning: implicit declaration of function 'PID_Init' [-Wimplicit-function-declaration] 111 | PID_Init(&pid, 1.0f, 0.01f, 0.001f, 1000.0f); // 初始PID参数 | ^~~~~~~~ ../Core/Src/main.c:112:3: warning: implicit declaration of function 'OLED_Init' [-Wimplicit-function-declaration] 112 | OLED_Init(); | ^~~~~~~~~ ../Core/Src/main.c:113:3: warning: implicit declaration of function 'COMM_Init' [-Wimplicit-function-declaration] 113 | COMM_Init(&huart1); | ^~~~~~~~~ ../Core/Src/main.c:129:7: warning: implicit declaration of function 'COMM_Process' [-Wimplicit-function-declaration] 129 | COMM_Process(); | ^~~~~~~~~~~~ ../Core/Src/main.c:136:11: warning: implicit declaration of function 'OLED_ShowStatus' [-Wimplicit-function-declaration] 136 | OLED_ShowStatus(target_rpm, encoder.rpm, | ^~~~~~~~~~~~~~~ ../Core/Src/main.c:136:46: error: request for member 'rpm' in something not a structure or union 136 | OLED_ShowStatus(target_rpm, encoder.rpm, | ^ ../Core/Src/main.c:137:29: error: request for member 'Kp' in something not a structure or union 137 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:137:37: error: request for member 'Ki' in something not a structure or union 137 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:137:45: error: request for member 'Kd' in something not a structure or union 137 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:140:11: warning: implicit declaration of function 'COMM_SendData' [-Wimplicit-function-declaration] 140 | COMM_SendData(target_rpm, encoder.rpm, | ^~~~~~~~~~~~~ ../Core/Src/main.c:140:44: error: request for member 'rpm' in something not a structure or union 140 | COMM_SendData(target_rpm, encoder.rpm, | ^ ../Core/Src/main.c:141:27: error: request for member 'Kp' in something not a structure or union 141 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:141:35: error: request for member 'Ki' in something not a structure or union 141 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:141:43: error: request for member 'Kd' in something not a structure or union 141 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:199:1: error: expected declaration or statement at end of input 199 | } | ^ ../Core/Src/main.c: At top level: ../Core/Src/main.c:190:6: warning: 'Error_Handler' defined but not used [-Wunused-function] 190 | void Error_Handler(void) | ^~~~~~~~~~~~~ ../Core/Src/main.c:150:6: warning: 'SystemClock_Config' defined but not used [-Wunused-function] 150 | void SystemClock_Config(void) | ^~~~~~~~~~~~~~~~~~ make: *** [Core/Src/subdir.mk:61: Core/Src/main.o] Error 1 make: *** Waiting for unfinished jobs.... ../Core/Src/oled.c:11:10: fatal error: ssd1306.h: No such file or directory 11 | #include "ssd1306.h" // 第三方OLED库 | ^~~~~~~~~~~ compilation terminated. make: *** [Core/Src/subdir.mk:61: Core/Src/oled.o] Error 1 "make -j16 all" terminated with exit code 2. Build might be incomplete. 22:42:51 Build Failed. 22 errors, 10 warnings. (took 4s.507ms)
最新发布
06-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值