我的创作纪念日

机缘

第一次接触csdn是因为看到baidu上很多代码都是来自于这里,没有账号就无法copy,所以就注册了一个账号。

由于我是一个表达欲很强的OIer,所以就开始慢慢写一些文章。


收获

其实没有什么收获,没有粉丝,没有太多的阅读量。但是我依然很开心,也会一直写下去。


日常

刷题->不会->看题解->哦↗↘->有意思->AC->写blog->发表


成就

提示:你过去写得最好的一段代码是什么? 请用代码块贴出来
题目:Code The Tree

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
string tree;
int main(){
	while(getline(cin,tree)){//The string probably have space
		//create a tree
		if(tree.find('(')==0&&tree.find(')')==tree.size()-1){
			puts("");
			continue;
		}
		else{
			vector<int>Tree[55];
			stack<int>num;//To save the numbers of nodes from the Tree
			int len=tree.size(),node=0/*to save how many nodes there are*/;
			for(int i=0;i<len-1/*Avoid exiting the stack when it is empty*/;){
				//save number of nodes
				if(/*is number*/tree[i]>='0'&&tree[i]<='9'&&i<len/*Avoid exceeding the length of the string*/){
					int temp=0;
					while(tree[i]>='0'&&tree[i]<='9'&&i<len){
						temp=temp*10+tree[i]-'0';
						i++;
					}
					node++;
					//push this number into the stack
					num.push(temp);
				}
				if(tree[i]=='('||tree[i]==' ')i++;//Omitted the char when it is "(" or space
				if(tree[i]==')'){//exiting the stack to push back into Tree the vector
					int n1=num.top();
					num.pop();//exiting
					int n2=num.top();//this node is not exit yet
					Tree[n1].push_back(n2);
					Tree[n2].push_back(n1);//creating a tree
					i++;//Don't forget
				}
			}
			//That is the end of this part
			for(int i=1;i<=node;i++){
				sort(Tree[i].begin(),Tree[i].end());
			}
			//
			vector<int>ans;
			int N=node-1;//There are N nodes need to delete
			while(N--){
				for(int i=1;i<=node;i++){
					int to;
					if(Tree[i].size()==1){
						//delete
						to=Tree[i][0];
						ans.push_back(to);
						Tree[i].resize(0);
						vector<int>::iterator pos;
						pos=lower_bound(Tree[to].begin(),Tree[to].end(),i);
						Tree[to].erase(pos);
						break;//each operate just delete one node
					}
				}
			}
			for(int i=0;i<ans.size();i++){
				//TODO
				if(i==0)cout<<ans[i];
				else cout<<" "<<ans[i];
			}
			cout<<endl;
		}
	}
	return 0;
}

憧憬

小目标: 参加NOI

Tips

  1. 您发布的文章将会展示至 里程碑专区 ,您也可以在 专区 内查看其他创作者的纪念日文章
  2. 优质的纪念文章将会获得神秘打赏哦
Windows 系统修复工具主要用于解决 Windows 11/10 系统中的各种常见问题,具有操作简单、功能全面等特点: 文件资源管理器修复:可解决文件资源管理器卡死、崩溃、无响应等问题,能终止崩溃循环。还可修复右键菜单无响应或选项缺失问题,以及重建缩略图缓存,让图片、视频等文件的缩略图正常显示,此外,还能处理桌面缺少回收站图标、回收站损坏等问题。 互联网和连接修复:能够刷新 DNS 缓存,加速网页加载速度,减少访问延迟。可重置 TCP/IP 协议栈,增强网络连接稳定性,减少网络掉线情况,还能还原 Hosts 文件,清除恶意程序对网络设置的篡改,保障网络安全,解决电脑重装系统后网络无法连接、浏览器主页被篡改等问题。 系统修复:集成系统文件检查器(SFC),可自动扫描并修复受损的系统文件。能解决 Windows 激活状态异常的问题,还可重建 DLL 注册库,恢复应用程序兼容性,解决部分软件无法正常运行的问题,同时也能处理如 Windows 沙箱无法启动、Windows 将 JPG 或 JPEG 保存为 JFIF 等系统问题。 系统工具维护:提供启动管理器、服务管理器和进程管理器等工具,用户可控制和管理启动程序、系统服务和当前运行的进程,提高系统的启动和运行速度,防止不必要的程序和服务占用系统资源。还能查看系统规格,如处理器线程数、最大显示分辨率等。 故障排除:集成超过 20 个微软官方诊断工具,可对系统问题进行专业排查,还能生成硬件健康状态报告。能解决搜索和索引故障、邮件和日历应用程序崩溃、设置应用程序无法启动等问题,也可处理打印机、网络适配器、Windows 更新等相关故障。 其他修复功能:可以重置组策略设置、catroot2 文件夹、记事本等多种系统设置和组件,如重置 Windows 应用商店缓存、Windows 防火墙设置等。还能添加重建图标缓存支持,恢复粘滞便笺删除
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值