-
Bio
CCW名字:一只鼠标 头像是波兰球
ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็
哪个傻子会在主页放一堆照片啊
巅峰对决

神秘71比赛分
这么多!畏惧了(右侧进度条)#include <iostream> #include <string> #include <vector> #include <cstdlib> #include <ctime> #include <algorithm> using namespace std; // 阵营枚举 enum Faction { ALLIES, AXIS, SOVIET, ITALY, JAPAN }; // 资源类型枚举 enum ResourceType { SOLDIERS, TANKS, AIRCRAFTS, SUPPLIES, MORALE }; // 玩家类 class Player { public: string name; Faction faction; int soldiers; int tanks; int aircrafts; int supplies; int morale; int territory; int experience; int research_points; bool has_nuclear_weapon; int victory_points; Player() : soldiers(100), tanks(10), aircrafts(5), supplies(200), morale(80), territory(50), experience(0), research_points(0), has_nuclear_weapon(false), victory_points(0) {} void displayStatus() { cout << "=== " << name << " 状态 ===" << endl; cout << "士兵: " << soldiers << endl; cout << "坦克: " << tanks << endl; cout << "飞机: " << aircrafts << endl; cout << "补给: " << supplies << endl; cout << "士气: " << morale << endl; cout << "领土: " << territory << "%" << endl; cout << "经验: " << experience << endl; cout << "研究点: " << research_points << endl; cout << "核武器: " << (has_nuclear_weapon ? "是" : "否") << endl; cout << "胜利点: " << victory_points << "/100" << endl; cout << "========================" << endl; } }; // 游戏主类 class WW2Game { private: Player player; bool gameRunning; int turn; int enemy_strength; public: WW2Game() : gameRunning(true), turn(1), enemy_strength(70) {} void start() { cout << "欢迎来到二战策略游戏!" << endl; chooseFaction(); gameLoop(); } void chooseFaction() { cout << "请选择你的阵营:" << endl; cout << "1. 同盟国 (Allies)" << endl; cout << "2. 轴心国 (Axis)" << endl; cout << "3. 苏联 (Soviet)" << endl; cout << "4. 意大利 (Italy)" << endl; cout << "5. 日本 (Japan)" << endl; int choice; cin >> choice; switch (choice) { case 1: player.faction = ALLIES; player.name = "同盟国"; break; case 2: player.faction = AXIS; player.name = "轴心国"; break; case 3: player.faction = SOVIET; player.name = "苏联"; break; case 4: player.faction = ITALY; player.name = "意大利"; break; case 5: player.faction = JAPAN; player.name = "日本"; break; default: player.faction = ALLIES; player.name = "同盟国"; break; } cout << "你选择了 " << player.name << " 阵营。" << endl; } void gameLoop() { while (gameRunning) { displayTurnInfo(); displayMenu(); int choice; cin >> choice; handleChoice(choice); checkVictoryCondition(); turn++; } } void displayTurnInfo() { cout << "\n=== 第 " << turn << " 回合 ===" << endl; cout << "敌方实力: " << enemy_strength << "%" << endl; } void displayMenu() { cout << "\n请选择行动:" << endl; cout << "1. 查看状态" << endl; cout << "2. 补给部队" << endl; cout << "3. 发动攻击" << endl; cout << "4. 侦察敌情" << endl; cout << "5. 休整部队" << endl; cout << "6. 扩张领土" << endl; cout << "7. 研究科技" << endl; cout << "8. 空中支援" << endl; cout << "9. 战略撤退" << endl; cout << "10. 核武器研发" << endl; cout << "11. 退出游戏" << endl; } void handleChoice(int choice) { switch (choice) { case 1: player.displayStatus(); break; case 2: supplyTroops(); break; case 3: launchAttack(); break; case 4: scoutEnemy(); break; case 5: restTroops(); break; case 6: expandTerritory(); break; case 7: researchTechnology(); break; case 8: airSupport(); break; case 9: strategicRetreat(); break; case 10: developNuclearWeapon(); break; case 11: gameRunning = false; cout << "游戏结束。" << endl; break; default: cout << "无效选择,请重新输入。" << endl; } } void supplyTroops() { if (player.supplies >= 20) { player.soldiers += 15; player.tanks += 2; player.supplies -= 20; cout << "部队已补充兵员和装备。" << endl; } else { cout << "补给不足!" << endl; } } void launchAttack() { srand(time(0) + turn); if (player.soldiers < 10) { cout << "士兵数量不足,无法发动攻击!" << endl; return; } int damage = rand() % 30 + 10 + (player.tanks * 2); int loss = rand() % 15 + 5 - (player.morale / 20); // 确保损失不为负数 loss = max(1, loss); player.soldiers -= loss; player.morale += 3; player.experience += 5; player.victory_points += damage / 10; // 减少敌方实力 enemy_strength = max(0, enemy_strength - (damage / 5)); cout << "发动攻击!造成敌方 " << damage << " 点损失。" << endl; cout << "我方损失 " << loss << " 名士兵。" << endl; if (player.soldiers <= 0) { cout << "你的军队已被击败,游戏结束。" << endl; gameRunning = false; } } void scoutEnemy() { srand(time(0) + turn * 2); int info = rand() % 4; switch (info) { case 0: cout << "侦察兵报告:敌方正在集结坦克部队。" << endl; break; case 1: cout << "侦察兵报告:敌方补给线出现薄弱点。" << endl; break; case 2: cout << "侦察兵报告:敌方士气低落。" << endl; break; case 3: cout << "侦察兵报告:发现敌方秘密基地位置。" << endl; break; } player.morale += 2; } void restTroops() { player.morale += 15; player.soldiers += 5; player.supplies -= 10; cout << "部队休整完毕,士气和兵力得到提升。" << endl; } // 新功能1:扩张领土 void expandTerritory() { if (player.soldiers < 30) { cout << "士兵数量不足,无法扩张领土!需要至少30名士兵。" << endl; return; } srand(time(0) + turn * 3); int expansion = rand() % 8 + 3; int cost = expansion * 2; if (player.supplies >= cost) { player.territory += expansion; player.supplies -= cost; player.experience += 10; cout << "成功扩张领土 " << expansion << "%!" << endl; } else { cout << "补给不足,无法扩张领土!" << endl; } } // 新功能2:研究科技 void researchTechnology() { if (player.research_points < 20) { cout << "研究点不足!当前研究点:" << player.research_points << "/20" << endl; return; } srand(time(0) + turn * 4); int tech = rand() % 3; player.research_points -= 20; switch (tech) { case 0: player.tanks += 3; cout << "研发成功!获得新型坦克技术,坦克数量增加3辆。" << endl; break; case 1: player.aircrafts += 2; cout << "研发成功!获得新型战机技术,飞机数量增加2架。" << endl; break; case 2: player.morale += 20; cout << "研发成功!获得心理战技术,士气提升20点。" << endl; break; } } // 新功能3:空中支援 void airSupport() { if (player.aircrafts < 2) { cout << "飞机数量不足!需要至少2架飞机。" << endl; return; } if (player.supplies < 30) { cout << "补给不足!需要30点补给。" << endl; return; } srand(time(0) + turn * 5); int damage = rand() % 40 + 20; player.supplies -= 30; player.aircrafts -= 1; // 消耗一架飞机 enemy_strength = max(0, enemy_strength - (damage / 3)); player.victory_points += 15; cout << "发动空中支援!造成敌方 " << damage << " 点损失。" << endl; cout << "消耗1架飞机和30点补给。" << endl; } // 新功能4:战略撤退 void strategicRetreat() { srand(time(0) + turn * 6); int recover = rand() % 20 + 10; player.soldiers += recover; player.morale += 10; player.supplies -= 15; cout << "执行战略撤退,保存实力。" << endl; cout << "恢复 " << recover << " 名士兵,士气提升10点。" << endl; } // 新功能5:核武器研发 void developNuclearWeapon() { if (player.has_nuclear_weapon) { cout << "你已经拥有核武器!" << endl; return; } if (player.research_points < 100) { cout << "研究点不足!需要100点研究点,当前:" << player.research_points << endl; return; } if (player.experience < 200) { cout << "经验不足!需要200点经验,当前:" << player.experience << endl; return; } player.research_points -= 100; player.experience -= 200; player.has_nuclear_weapon = true; player.victory_points += 50; cout << "核武器研发成功!你获得了终极武器!" << endl; cout << "胜利点数大幅提升!" << endl; } // 胜利检测 void checkVictoryCondition() { // 敌方被击败 if (enemy_strength <= 0) { cout << "\n★ 恭喜!你成功击败了敌方势力! ★" << endl; cout << "你赢得了二战的胜利!" << endl; gameRunning = false; return; } // 胜利点数达到100 if (player.victory_points >= 100) { cout << "\n★ 恭喜!你达成了100胜利点! ★" << endl; cout << "你赢得了二战的胜利!" << endl; gameRunning = false; return; } // 拥有核武器且领土达到90% if (player.has_nuclear_weapon && player.territory >= 90) { cout << "\n★ 恭喜!你拥有核武器并控制了大部分领土! ★" << endl; cout << "你赢得了二战的胜利!" << endl; gameRunning = false; return; } // 随机事件:获得研究点 srand(time(0) + turn * 7); if (turn % 3 == 0) { int points = rand() % 10 + 5; player.research_points += points; cout << "获得 " << points << " 点研究点!" << endl; } } }; int main() { WW2Game game; game.start(); return 0; }```一只鼠标 -
Accepted Problems
-
Recent Activities
- 【初2024级】寒假模拟赛 Ledo
- 【初2024级】基础数论 Assignment
- 【初2024级】拓扑排序 Assignment
- 【初2024级】并查集 Assignment
- 【初2024】背包拓展 Assignment
- 【CSP-J 2025】改题 IOI
- 【CSP-J模拟赛1】Day5 IOI
- CSP-S复赛模拟3 IOI
- CSP-S复赛模拟2 IOI
- 【CSP-J 2023】Day4 IOI
- CSP-J复赛模拟6 IOI
- CSP-J复赛模拟5 IOI
- 【CSP-J2022改 】Day 3 IOI
- CSP-S真题模拟赛 OI
- CSP-J复赛模拟3 IOI
- 【CSP-J2021】Day2 IOI
- 【CSP-J2024】Day1 IOI
- CSP-J模拟赛1 IOI
- 【2024级】背包问题 Assignment
-
Recent Solutions
This person is lazy and didn't wrote any solution
Problem Tags
- 动态规划
- 7
- 背包
- 7
- 2018
- 1
- 背包 DP
- 1
- 早于 2010
- 1
- 数论
- 1
- NOIP 提高组
- 1
- 哈希
- 1
- DP
- 1