CMakeLists.txt
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
.venv
|
||||
cmake-build-debug
|
||||
/*.exe
|
||||
/*.dSYM
|
||||
|
||||
|
||||
Generated
+1
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="com.codeverse.userSettings.MarscodeWorkspaceAppSettingsState">
|
||||
<option name="chatAppRouterInfo" value="chat-session" />
|
||||
<option name="progress" value="1.0" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+1
@@ -255,6 +255,7 @@
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/EMPTY_BLOCK_STYLE/@EntryValue" value="TOGETHER_SAME_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/EXPORT_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
|
||||
Generated
+218
-71
@@ -20,7 +20,29 @@
|
||||
</component>
|
||||
<component name="CMakeRunConfigurationManager">
|
||||
<generated>
|
||||
<config projectName="Project" targetName="exercises" />
|
||||
<config projectName="exercises" targetName="pojcs101_M02692_12_coins" />
|
||||
<config projectName="exercises" targetName="luogu_ez_B3628" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01328_radar_greedy" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01852_ants_falling" />
|
||||
<config projectName="exercises" targetName="pojcs101_M02692_12_coins_WRONG" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01321_chest_grid" />
|
||||
<config projectName="exercises" targetName="pojcs101_M02039_snakey_encryption" />
|
||||
<config projectName="exercises" targetName="pojcs101_E02883" />
|
||||
<config projectName="exercises" targetName="pojcs101_M02694_polish_notation_tree" />
|
||||
<config projectName="exercises" targetName="CMakeCXXCompilerId" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01017_6_boxes" />
|
||||
<config projectName="exercises" targetName="apple-sdk" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01088_ski_WRONG" />
|
||||
<config projectName="exercises" targetName="pojcs101_M02431_cows_gas_leak_WRONG" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01922_ride_follower" />
|
||||
<config projectName="exercises" targetName="luogu_template_dsu_P3367" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01002_memorable_number" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01088_ski" />
|
||||
<config projectName="exercises" targetName="pojcs101_M02524_ubiquitous_religions_dsu" />
|
||||
<config projectName="exercises" targetName="pojcs101_E01003" />
|
||||
<config projectName="exercises" targetName="pojcs101_M01328_radar_greedy_WRONG" />
|
||||
<config projectName="exercises" targetName="pojcs101_E01218" />
|
||||
<config projectName="exercises" targetName="exercises" />
|
||||
</generated>
|
||||
</component>
|
||||
<component name="CMakeSettings">
|
||||
@@ -30,10 +52,14 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="4491295e-723c-4e0b-b7b4-9be1cbde5db8" name="更改" comment="1">
|
||||
<change afterPath="$PROJECT_DIR$/pojcs101_M02039_snakey_encryption.cpp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/pojcs101_M02431_cows_gas_leak_WRONG.cpp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/pojcs101_M02524_ubiquitous_religions_dsu.cpp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/CMakeLists.txt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/luogu_template_dsu_P3367.cpp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/pojcs101_M02694_polish_notation_tree.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/MarsCodeWorkspaceAppSettings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/MarsCodeWorkspaceAppSettings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/editor.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/editor.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pojcs101_M02524_ubiquitous_religions_dsu.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/pojcs101_M02524_ubiquitous_religions_dsu.cpp" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -53,6 +79,7 @@
|
||||
<list>
|
||||
<option value="C++ Single file program" />
|
||||
<option value="C++ Single file for OJ" />
|
||||
<option value="CMakeLists.txt" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@@ -82,94 +109,214 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"C/C++ 文件.D_pojcs101_M02692.cpp.executor": "Run",
|
||||
"C/C++ 文件.luogu_UVA755.cpp.executor": "Run",
|
||||
"C/C++ 文件.luogu_ez_B3628.cpp.executor": "Run",
|
||||
"C/C++ 文件.ojcs101_E01003.cpp.executor": "Run",
|
||||
"C/C++ 文件.ojcs101_E01218.cpp.executor": "Run",
|
||||
"C/C++ 文件.ojcs101_E02883.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M01017_6_boxes.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M01088_ski.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M01321_chest_grid.cpp.executor": "Debug",
|
||||
"C/C++ 文件.pojcs101_M01328_radar_greedy.cpp.executor": "Debug",
|
||||
"C/C++ 文件.pojcs101_M01852_ants_falling.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M01922_ride_follower.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M02039_snakey_encryption.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M02431_cows_gas_leak.cpp.executor": "Debug",
|
||||
"C/C++ 文件.pojcs101_M02692.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M02692_12_coins.cpp.executor": "Run",
|
||||
"CMake 应用程序.exercises.executor": "Run",
|
||||
"CidrDebugProfileConversion": "true",
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"Python.lc_127.executor": "Run",
|
||||
"RunOnceActivity.RadMigrateCodeStyle": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"RunOnceActivity.readMode.enableVisualFormatting": "true",
|
||||
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
||||
"RunOnceActivity.west.config.association.type.startup.service": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"cf.first.check.clang-format": "false",
|
||||
"cidr.known.project.marker": "true",
|
||||
"codeWithMe.voiceChat.enabledByDefault": "false",
|
||||
"git-widget-placeholder": "main",
|
||||
"last_opened_file_path": "/Users/roger/coding/exercises",
|
||||
"node.js.detected.package.jshint": "true",
|
||||
"node.js.selected.package.jshint": "",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"org.rust.first.attach.projects": "true",
|
||||
"settings.editor.selected.configurable": "preferences.sourceCode.C++"
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"C/C++ 文件.D_pojcs101_M02692.cpp.executor": "Run",
|
||||
"C/C++ 文件.luogu_UVA755.cpp.executor": "Run",
|
||||
"C/C++ 文件.luogu_ez_B3628.cpp.executor": "Run",
|
||||
"C/C++ 文件.luogu_model_dsu_P3367.cpp.executor": "Run",
|
||||
"C/C++ 文件.ojcs101_E01003.cpp.executor": "Run",
|
||||
"C/C++ 文件.ojcs101_E01218.cpp.executor": "Run",
|
||||
"C/C++ 文件.ojcs101_E02883.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M01017_6_boxes.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M01088_ski.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M01321_chest_grid.cpp.executor": "Debug",
|
||||
"C/C++ 文件.pojcs101_M01328_radar_greedy.cpp.executor": "Debug",
|
||||
"C/C++ 文件.pojcs101_M01852_ants_falling.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M01922_ride_follower.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M02039_snakey_encryption.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M02431_cows_gas_leak.cpp.executor": "Debug",
|
||||
"C/C++ 文件.pojcs101_M02524_ubiquitous_religions_dsu.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M02692.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M02692_12_coins.cpp.executor": "Run",
|
||||
"C/C++ 文件.pojcs101_M02694_polish_notation_tree.cpp.executor": "Run",
|
||||
"CMake 应用程序.exercises.executor": "Run",
|
||||
"CMake 应用程序.pojcs101_M02694_polish_notation_tree.executor": "Debug",
|
||||
"CidrDebugProfileConversion": "true",
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"Python.lc_127.executor": "Run",
|
||||
"RunOnceActivity.RadMigrateCodeStyle": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"RunOnceActivity.readMode.enableVisualFormatting": "true",
|
||||
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
||||
"RunOnceActivity.west.config.association.type.startup.service": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"cf.first.check.clang-format": "false",
|
||||
"cidr.known.project.marker": "true",
|
||||
"codeWithMe.voiceChat.enabledByDefault": "false",
|
||||
"deletionFromPopupRequiresConfirmation": "false",
|
||||
"git-widget-placeholder": "main",
|
||||
"last_opened_file_path": "/Users/roger/coding/exercises",
|
||||
"node.js.detected.package.jshint": "true",
|
||||
"node.js.selected.package.jshint": "",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"org.rust.first.attach.projects": "true",
|
||||
"settings.editor.selected.configurable": "CPPToolchains"
|
||||
}
|
||||
}]]></component>
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="C/C++ 文件.pojcs101_M02431_cows_gas_leak.cpp">
|
||||
<configuration name="pojcs101_M01328_radar_greedy.cpp" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" temporary="true" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01328_radar_greedy.cpp" CONFIG_NAME="pojcs101_M01328_radar_greedy.cpp">
|
||||
<option name="sourceFile" value="pojcs101_M01328_radar_greedy.cpp" />
|
||||
<component name="RunManager" selected="CMake 应用程序.pojcs101_M02694_polish_notation_tree">
|
||||
<configuration default="true" type="CMakeBoostTestRunConfigurationType" factoryName="Boost Test" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" TEST_MODE="SUITE_TEST">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
|
||||
<option name="BeforeTestRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01852_ants_falling.cpp" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" temporary="true" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01852_ants_falling.cpp" CONFIG_NAME="pojcs101_M01852_ants_falling.cpp">
|
||||
<option name="sourceFile" value="pojcs101_M01852_ants_falling.cpp" />
|
||||
<configuration default="true" type="CMakeCatchTestRunConfigurationType" factoryName="Catch Test" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" TEST_MODE="SUITE_TEST">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
|
||||
<option name="BeforeTestRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01922_ride_follower.cpp" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" temporary="true" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01922_ride_follower.cpp" CONFIG_NAME="pojcs101_M01922_ride_follower.cpp">
|
||||
<option name="sourceFile" value="pojcs101_M01922_ride_follower.cpp" />
|
||||
<configuration default="true" type="CMakeDoctestTestRunConfigurationType" factoryName="doctest Test" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" TEST_MODE="SUITE_TEST">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
|
||||
<option name="BeforeTestRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M02039_snakey_encryption.cpp" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" temporary="true" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M02039_snakey_encryption.cpp" CONFIG_NAME="pojcs101_M02039_snakey_encryption.cpp">
|
||||
<option name="sourceFile" value="pojcs101_M02039_snakey_encryption.cpp" />
|
||||
<configuration default="true" type="CMakeGoogleTestRunConfigurationType" factoryName="Google Test" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" TEST_MODE="SUITE_TEST">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
|
||||
<option name="BeforeTestRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M02431_cows_gas_leak.cpp" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" temporary="true" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M02431_cows_gas_leak.cpp" CONFIG_NAME="pojcs101_M02431_cows_gas_leak.cpp">
|
||||
<option name="sourceFile" value="pojcs101_M02431_cows_gas_leak.cpp" />
|
||||
<configuration name="CMakeCXXCompilerId" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="CMakeCXXCompilerId" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="CMakeCXXCompilerId">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="C/C++ 文件.pojcs101_M02431_cows_gas_leak.cpp" />
|
||||
<item itemvalue="C/C++ 文件.pojcs101_M02039_snakey_encryption.cpp" />
|
||||
<item itemvalue="C/C++ 文件.pojcs101_M01922_ride_follower.cpp" />
|
||||
<item itemvalue="C/C++ 文件.pojcs101_M01852_ants_falling.cpp" />
|
||||
<item itemvalue="C/C++ 文件.pojcs101_M01328_radar_greedy.cpp" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
<configuration name="apple-sdk" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="apple-sdk" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="apple-sdk">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="luogu_ez_B3628" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="luogu_ez_B3628" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="luogu_ez_B3628">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="luogu_template_dsu_P3367" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="luogu_template_dsu_P3367" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="luogu_template_dsu_P3367">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_E01003" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_E01003" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_E01003">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_E01218" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_E01218" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_E01218">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_E02883" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_E02883" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_E02883">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01002_memorable_number" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01002_memorable_number" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01002_memorable_number">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01017_6_boxes" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01017_6_boxes" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01017_6_boxes">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01088_ski" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01088_ski" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01088_ski">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01088_ski_WRONG" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01088_ski_WRONG" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01088_ski_WRONG">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01321_chest_grid" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01321_chest_grid" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01321_chest_grid">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01328_radar_greedy" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01328_radar_greedy" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01328_radar_greedy">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01328_radar_greedy_WRONG" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01328_radar_greedy_WRONG" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01328_radar_greedy_WRONG">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01852_ants_falling" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01852_ants_falling" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01852_ants_falling">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M01922_ride_follower" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M01922_ride_follower" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M01922_ride_follower">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M02039_snakey_encryption" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M02039_snakey_encryption" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M02039_snakey_encryption">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M02431_cows_gas_leak_WRONG" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M02431_cows_gas_leak_WRONG" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M02431_cows_gas_leak_WRONG">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M02524_ubiquitous_religions_dsu" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M02524_ubiquitous_religions_dsu" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M02524_ubiquitous_religions_dsu">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M02692_12_coins" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M02692_12_coins" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M02692_12_coins">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M02692_12_coins_WRONG" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M02692_12_coins_WRONG" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M02692_12_coins_WRONG">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="pojcs101_M02694_polish_notation_tree" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="exercises" TARGET_NAME="pojcs101_M02694_polish_notation_tree" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="exercises" RUN_TARGET_NAME="pojcs101_M02694_polish_notation_tree">
|
||||
<method v="2">
|
||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<list>
|
||||
<item itemvalue="CMake 应用程序.apple-sdk" />
|
||||
<item itemvalue="CMake 应用程序.CMakeCXXCompilerId" />
|
||||
<item itemvalue="CMake 应用程序.luogu_ez_B3628" />
|
||||
<item itemvalue="CMake 应用程序.luogu_template_dsu_P3367" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_E01003" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_E01218" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_E02883" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01002_memorable_number" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01017_6_boxes" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01088_ski" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01088_ski_WRONG" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01321_chest_grid" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01328_radar_greedy" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01328_radar_greedy_WRONG" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01852_ants_falling" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M01922_ride_follower" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M02039_snakey_encryption" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M02431_cows_gas_leak_WRONG" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M02524_ubiquitous_religions_dsu" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M02692_12_coins" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M02692_12_coins_WRONG" />
|
||||
<item itemvalue="CMake 应用程序.pojcs101_M02694_polish_notation_tree" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(exercises)
|
||||
|
||||
# 设置 C++ 标准(例如 C++17)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# 递归查找当前目录下所有的 .cpp 文件
|
||||
file(GLOB_RECURSE SOURCES "*.cpp")
|
||||
|
||||
# 遍历所有找到的 .cpp 文件,为每个文件单独创建一个可执行目标
|
||||
foreach(source ${SOURCES})
|
||||
# 获取文件名(不带扩展名)作为可执行文件的名字
|
||||
get_filename_component(name ${source} NAME_WE)
|
||||
add_executable(${name} ${source})
|
||||
endforeach()
|
||||
@@ -0,0 +1,48 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Dsu {
|
||||
public:
|
||||
struct Node {
|
||||
size_t parent, size;
|
||||
};
|
||||
|
||||
vector<Node> nodes;
|
||||
|
||||
explicit Dsu(const size_t size) : nodes(size) {
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
nodes[i] = {.parent = i, .size = 0};
|
||||
}
|
||||
}
|
||||
|
||||
size_t find(const size_t x) {
|
||||
if (nodes[x].parent == x) { return x; }
|
||||
return nodes[x].parent = find(nodes[x].parent);
|
||||
}
|
||||
|
||||
void unite(size_t x, size_t y) {
|
||||
if ((x = find(x)) == (y = find(y))) { return; }
|
||||
if (nodes[x].size > nodes[y].size) { swap(x, y); }
|
||||
nodes[x].parent = y;
|
||||
nodes[y].size += nodes[x].size;
|
||||
}
|
||||
};
|
||||
|
||||
int main() {
|
||||
ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int elements_count, operations_count;
|
||||
cin >> elements_count >> operations_count;
|
||||
Dsu dsu(elements_count);
|
||||
for (int _ = 0; _ < operations_count; _++) {
|
||||
int op, x, y;
|
||||
cin >> op >> x >> y;
|
||||
if (op == 1) { dsu.unite(x, y); }
|
||||
if (op == 2) { cout << (dsu.find(x) == dsu.find(y) ? 'Y' : 'N') << endl; }
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -34,5 +34,20 @@ int main() {
|
||||
ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
size_t students_count, pairs_count;
|
||||
for (int case_id = 1; cin >> students_count >> pairs_count && students_count; case_id++) {
|
||||
cout << "Case " << case_id << ": ";
|
||||
Dsu dsu(students_count);
|
||||
size_t x, y, ans = 0;
|
||||
for (int _ = 0; _ < pairs_count; _++) {
|
||||
cin >> x >> y;
|
||||
dsu.unite(x - 1, y - 1);
|
||||
}
|
||||
for (size_t node_id = 0; node_id < students_count; node_id++) {
|
||||
ans += node_id == dsu.find(node_id);
|
||||
}
|
||||
cout << ans << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
#include <variant>
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <cstdio>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
class NotationTree {
|
||||
public:
|
||||
using Data = variant<double, char>;
|
||||
|
||||
struct TreeNode {
|
||||
Data data;
|
||||
optional<size_t> left_idx, right_idx;
|
||||
|
||||
explicit TreeNode(const string& value) { data = parse_string(value); }
|
||||
explicit TreeNode(const Data value) { data = value; }
|
||||
|
||||
[[nodiscard]] bool is_operator() const {
|
||||
return std::holds_alternative<char>(data);
|
||||
}
|
||||
|
||||
[[nodiscard]] char get_operator() const {
|
||||
if (!is_operator()) { throw invalid_argument("Node is not operator"); }
|
||||
return get<char>(data);
|
||||
}
|
||||
|
||||
[[nodiscard]] double get_number() const {
|
||||
if (is_operator()) { throw invalid_argument("Node is operator"); }
|
||||
return get<double>(data);
|
||||
}
|
||||
};
|
||||
|
||||
static Data parse_string(const string& value) {
|
||||
if (value == "+" || value == "-" || value == "*" || value == "/") {
|
||||
return value[0];
|
||||
}
|
||||
return stod(value);
|
||||
}
|
||||
|
||||
vector<TreeNode> nodes;
|
||||
|
||||
tuple<size_t, size_t> build_from_poland(const vector<Data>& datas, const size_t start_idx = 0) {
|
||||
size_t this_idx = nodes.size();
|
||||
nodes.emplace_back(datas[start_idx]);
|
||||
if (!nodes.back().is_operator()) { return make_tuple(this_idx, start_idx + 1); }
|
||||
auto [left_idx, right_start_idx] = build_from_poland(datas, start_idx + 1);
|
||||
nodes[this_idx].left_idx = left_idx;
|
||||
auto [right_idx, right_end_idx] = build_from_poland(datas, right_start_idx);
|
||||
nodes[this_idx].right_idx = right_idx;
|
||||
return make_tuple(this_idx, right_end_idx);
|
||||
}
|
||||
|
||||
double calculate(const size_t idx = 0) {
|
||||
if (!nodes[idx].is_operator()) {
|
||||
return nodes[idx].get_number();
|
||||
}
|
||||
if (!nodes[idx].left_idx.has_value() || !nodes[idx].right_idx.has_value()) {
|
||||
throw invalid_argument("Tree is not complete");
|
||||
}
|
||||
const double left_result = calculate(nodes[idx].left_idx.value()),
|
||||
right_result = calculate(nodes[idx].right_idx.value());
|
||||
switch (nodes[idx].get_operator()) {
|
||||
case '+': return left_result + right_result;
|
||||
case '-': return left_result - right_result;
|
||||
case '*': return left_result * right_result;
|
||||
case '/': return left_result / right_result;
|
||||
default: throw invalid_argument("Invalid operator");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
string poland_notation, token;
|
||||
vector<NotationTree::Data> datas;
|
||||
getline(cin, poland_notation);
|
||||
stringstream ss(poland_notation);
|
||||
while (ss >> token) {
|
||||
datas.push_back(NotationTree::parse_string(token));
|
||||
}
|
||||
NotationTree tree;
|
||||
tree.build_from_poland(datas);
|
||||
printf("%f\n", tree.calculate());
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user