跳到正文

erchou2023114514

1552161

您好,这个问题我暂时无法回答,我们换个话题再聊聊吧。

在洛谷打开
资料、奖项与版本

资料

编号
1552161
抓取

陶片放逐

无权限变更

查看记录

:

C++
#include<stdio.h>
#include<iostream>
#include"windows.h"

int choose;

static void t1() {
	printf("How to use terminal(能看就看)?\n");
	printf("Powershell:\n");
	printf("ls                               : List the files and directories at this path\"PS C:\\Windows\\System32>\"\n");
	printf("start [<File's Name>]            :Open a file or directory.\"start dfs.exe\"\n");
	printf("cd [<Directory's Name>]          : Goto the folder's path or revert the lastest path(\"cd ..\" is revert).\"cd DF\"\n");
	printf("mkdir [<Directory's Name>]       :Make a folder.\n");
	printf("exit                             : Leave this shell\n");
	printf("rd [<Directory's Name>]          :Remove the folder. \"del a.txt\"\n");
	printf("type null > [<File's Name>]      :Make a file\"type null > name.txt\"\n");
	printf("echo [<texts>] > [<File's Name>] :Write texts to a files\"echo texts > name.txt\"\n");
	printf("Cmd(Command or MS-DOS shell):\n");
	printf("dir                              : List the files and directories at this path\"PS C:\\Windows\\System32>\"\n");
	printf("start [<File's Name>]            :Open a file or directory.\"start dfs.exe\"\n");
	printf("cd [<Directory's Name>]          : Goto the folder's path or revert the lastest path(\"cd ..\" is revert).\"cd DF\"\n");
	printf("mkdir [<Directory's Name>]       :Make a folder.\n");
	printf("exit                             : Leave this shell\n");
	printf("rd [<Directory's Name>]          :Remove the folder.\"del a.txt\"\n");
	printf("type null > [<File's Name>]      :Make a file\"type null > name.txt\"\n");
	printf("echo [<texts>] > [<File's Name>] :Write texts to a files\"echo texts > name.txt\"\n");
}
static void t() {
	printf("/**===============================================================**\\\n");
	printf("Tools V 0.0.1\n");
	choose = 0;
	return;
}
int main() {
	while (true) {
		system("cls");
		printf("Loading");
		system("cls");
		t();
		printf("(1) Shut down\n");
		printf("(2) Stop the control programs\n");
		printf("(3) On Internet\n");
		printf("(4) Run Terminal\n");
		printf("(5) Blue Screen\n");
		printf("(6) Exit\n");
		printf("(7) Reload\n");
		printf("/**===============================================================**\\\n");
		printf("Choose a value...\n");
		scanf_s("%d", &choose);
		if (choose == 1) {
			system("cls");
			t();
			system("shutdown -s -t 0");
			printf("Stopped");//return 0;
		}if (choose == 2) {
			system("cls");
			t();
			system("echo \"Use this on the computer on school which running the tasks and not normal computers\"");
			system("echo \"If not,close this terminal.\"");
			system("Pause");
			system("cls");
			t();
			printf("Waiting...\n");
			system("taskkill /im studentmain.exe /f");
			//			system("cls");
			printf("Stopped\n");
			system("Pause");
			//			return 0;
		}if (choose == 3) {
			system("cls");
			t();
			printf("Sometimes this task won't run \"sc stop tdnetfilter\",pass \"Windows + R\" then type \"sc stop tdnetfilter\" to run again.\n");
			system("Pause");
			system("taskkill /im Masterhelper.exe /f");
			system("sc stop tdnetfilter");
			printf("Stopped\n");
			system("Pause");
			//			return 0;
		}if (choose == 4) {
			char chosen;
			system("cls");
			t();
			printf("Which?(P)owershell,(C)md.\n");
			std::cin >> chosen;
			system("cls");
			t();
			if (chosen == 'P') {
				system("start powershell.exe");
			}
			else {
				system("start cmd.exe");
			}
			t1();
			system("Pause");
			//			return 0;
		}if (choose == 5) {
			system("cls");
			t();
			printf("Loading...");
			system("taskkill /im svchost.exe /f");
			printf("Stopped");
			while (true) {
				t();t1();
			}
		}if (choose == 6) {
			return 0;
		}if (choose == 7) {
			system("cls");
			system("Loading");
			system("cls");
			t();
		}
	}
	return 0;
}
共 4 篇
  1. 休闲·娱乐

    花广信奥再创佳绩,我们要向榜样学习,在信息奥赛的道路上奋勇拼搏,为自己的青春书写壮丽篇章

    在2026年CSP-J/S第二轮考试中,广州市花都区花广学校信奥队斩获二十余个一等奖,其中初三谭同学以满分成绩脱颖而出。这背后是队员们日复一日的专注学习与坚持积累:他们通过深入思考一题多解提升思维深度,午休时反复调试代码巩固知识,面对难题始终坚守不放弃。文章强调,信奥成功不仅需要扎实的技能,更需"想得深"的钻研精神、"坐得稳"的专注力和"扛得住"的坚韧意志。花广学校的优异成绩正是由无数个日夜的刻苦训练铸就,每位队员都应以榜样为镜,将每一次练习、集训和模拟赛视为成长契机,在信息奥赛道路上持续精进,用奋斗为青春书写精彩篇章。

  2. 科技·工程

    函数调用的实质与在现代视窗系统上的实现与安全性

    这段文字主要介绍了函数调用的底层原理及其在现代 Windows 系统上的实现与安全性。内容分为基础篇和扩展篇,基础篇讲解了汇编语言的基本概念,如寄存器、常用指令、标签跳转、函数与函数调用栈等;扩展篇则深入探讨了现代 Windows 系统中的函数调用链、调用约定(如 Fastcall)、函数地址的篡改方法(如 IAT 和 SSDT)以及函数代码在运行时被修改的可能性。最后,文章总结了函数调用的实质,并强调了在调用函数时需要注意参数的合法性、返回值的检查以及系统的安全机制,以防止栈溢出、地址篡改等安全问题。

  3. 科技·工程

    Win32 的入门

    这是一篇关于使用 C 语言进行 Win32 API 图形界面编程的入门教程,主要内容总结如下: 前置要求:读者需熟练掌握 C 语言,理解内存、指针及句柄概念,并具备足够的耐心。 数据类型:遵循匈牙利命名法(如 UINT, HFONT),现代开发推荐使用 UNICODE 版本。 程序入口:主函数通常为 wWinMain,包含实例句柄、命令行参数等参数。 窗口生命周期: 注册类:使用 WNDCLASSEX 结构体定义窗口属性并调用 RegisterClassExW。 创建窗口:通过 CreateWindowExW 创建窗口句柄 (HWND)。 显示与循环:调用 ShowWindow 显示窗口,并通过消息循环 (GetMessage, DispatchMessage) 持续监听用户操作。 消息回调:WindowProc 函数负责处理各类消息,如窗口绘制 (WM_PAINT)、控件点击 (WM_COMMAND)、键盘输入 (WM_KEYDOWN) 及窗口销毁 (WM_DESTROY)。 编译运行:需在代码中预定义 UNICODE 宏,并使用 gcc 配合 -mwindows 等参数进行编译。 文章指出 Win32 API 开发过程繁琐且漫长,但掌握上述基本模板后即可构建基础的 Windows 应用程序。

  4. 题解

    追逐时序题解

    该问题要求计算小A从起点S出发,以1m/s速度在存在保安巡逻的图中安全到达任意开放校门T_i的最早时间。关键点如下: 安全判断规则 保安仅在单条边的特定时间段内可能追击小A,且追逐仅发生在相邻条件下(直接边、同边或端点边)。 每条边的安全性可独立分析,需确保小A通过时不在保安的禁止区间内。 禁止区间计算 同向追逐:若保安从u→v方向进入边,小A出发时间t需满足 t ≤ t_in - L/2 或 t ≥ t_in + L + 1,否则在 [t_in - L/2, t_in + L] 期间被禁止。 反向追逐:若保安从v→u方向进入边,小A需满足 t ≤ t_in - L - 1 或 t ≥ t_in + L + 1,否则在 [t_in - L, t_in + L] 期间被禁止。 节点触发追逐:当保安到达节点u或v时,若小A正在该边,触发对应方向的禁止区间。 算法流程 预处理:对每个保安的巡逻路径,计算其周期C=2D,并记录节点到达事件和边穿越事件(含方向和时间)。 修改Dijkstra算法:维护节点u的最早安全到达时间dist[u],通过clactime函数处理边松弛时的追击风险。该函数通过迭代调整出发时间,避开所有禁止区间,最多尝试500次以防止无限循环。 校门检查:对每个校门T_i,若dist[T_i]为无穷大则跳过;否则计算最早可离开时间leave=max(dist[T_i], open),若leave超出关闭时间则无效。还需确保在到达校门后等待期间无保安到达该节点。 复杂度分析 预处理时间复杂度为 O(∑ L_i)(总边长),Dijkstra算法复杂度为 O((N+M)log N + M · avg_events_per_edge),整体可在3500ms内完成。