【模板】拓扑排序 (Legal or Not题解)

拓扑排序的经典模板 你还在手打拓扑排序吗?那你赶紧下载这款源代码。它可以减轻你手的负担。 立即下载

作用:判断一个有向图是不是有向无环图(DAG)。

步骤:

1.邻接矩阵map[][]存储有向边的信息,indegree[]存储每一个结点的入度。

2.在有向图中寻找一个入度为0(没有前驱)的结点并记录。

3.删除该结点(indegree[i]置为-1)以及以该结点作为起点的边(若map[i][j]==1则置为0,同时indegree[j]--)。

4.重复步骤2和3,直到所有结点都输出,此时结点的输出序列就是一个拓扑排序。若不能把所有结点输出,则说明该有向图当中有环。

应用:课程先修问题、师傅徒弟问题、排名问题等。

Legal or Not

来源:王道论坛

题目描述

ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many "holy cows" like HH, hh, AC, ZT, lcc, BF, Qinz and so on chat on-line to exchange their ideas. When someone has questions, many warm-hearted cows like Lost will come to help. Then the one being helped will call Lost "master", and Lost will have a nice "prentice". By and by, there are many pairs of "master and prentice". But then problem occurs: there are too many masters and too many prentices, how can we know whether it is legal or not?We all know a master can have many prentices and a prentice may have a lot of masters too, it's legal. Nevertheless,some cows are not so honest, they hold illegal relationship. Take HH and 3xian for instant, HH is 3xian's master and, at the same time, 3xian is HH's master,which is quite illegal! To avoid this,please help us to judge whether their relationship is legal or not. Please note that the "master and prentice" relation is transitive. It means that if A is B's master ans B is C's master, then A is C's master.

输入


The input consists of several test cases. For each case, the first line contains two integers, N (members to be tested) and M (relationships to be tested)(2 <= N, M <= 100). Then M lines follow, each contains a pair of (x, y) which means x is y's master and y is x's prentice. The input is terminated by N = 0.TO MAKE IT SIMPLE, we give every one a number (0, 1, 2,..., N-1). We use their numbers instead of their names.

输出

For each test case, print in one line the judgement of the messy relationship.If it is legal, output "YES", otherwise "NO".

样例输入

4 3
0 1
1 2
2 3
3 3
0 1
1 2
2 0
0 1


样例输出

YES
NO
//Legal or not
//拓扑排序
//目的:检验有向图中是否为有向无环图(DAG) 
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int map[101][101];//邻接矩阵存储是否存在有向边 
int indegree[101];//记录每一个结点的入度
int main(void)
{
	int n,m;//n个点,m条有向边
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		if(n==0&m==0) break;
		memset(map,0,sizeof(map));
		memset(indegree,0,sizeof(indegree));
		int x,y;
		for(int i=0;i<m;i++){
			scanf("%d%d",&x,&y);//x是y的师傅
			map[x][y]=1;
			indegree[y]++;//y的入度加1 
		}
		int count=0;
		for(int k=0;k<n;k++){//最多尝试寻找n次 
			for(int i=0;i<n;i++){//遍历所有结点,寻找入度为0的 
				if(indegree[i]==0){
					count++;
					indegree[i]--;//置为-1表示已经找过
					for(int j=0;j<n;j++){
						if(map[i][j]==1){
							map[i][j]=0;//删除所有以该节点开始的边 
							indegree[j]--;//修改其入度 
						}
					}
					break; //每次只找一个结点
				}
			}
		} 
		if(n==count) printf("YES\n") ;
		else printf("NO\n");
	 } 
	 return 0;
 } 

 

Flutter项目在M1/M2 Mac上跑iOS模拟器报错?手把手教你搞定‘arm64架构不兼容’问题 本文详细解析了Flutter项目在M1/M2 Mac上运行iOS模拟器时遇到的‘arm64架构不兼容’问题,提供了多种解决方案,包括排除模拟器的arm64架构、强制使用x86_64架构以及修改插件Podspec文件。帮助开发者快速解决架构兼容性问题,提升开发效率。 阅读详情

相关推荐

电流采样(分流器与霍尔传感器)

霍尔效应霍尔效应是磁电效应的一种,这一现象是霍尔(A.H.Hall,1855—1938)于1879年在研究金属的导电机构时发现的。霍尔效应是研究半导体材料性能的基本方法。通过霍尔效应实验测定的霍尔系数,能够判断半导体材料的导电类型、载流子浓度及载流子迁移率等重要参数。简单原理如图1所示,半导体薄片两端通以控制电流I,垂直方向施加磁感应强度为B的匀强磁场,d为半导体材料的厚度,k为霍尔常数,它与半导体材质有关,则在垂直于电流和磁场的方向上,将产生电势差为UH的霍尔电压,它们之间的关系为。霍尔元件。

weixin_48867130的博客 1万+

拓扑排序详解(超详细+模板)

拓扑排序 1.什么是拓扑排序 对一个有向无环图(Directed Acyclic Graph简称DAG)G进行拓扑排序,是将G中所有顶点排成一个线性序列,使得图 中任 意一对顶点u和v,若边(u,v)∈E(G),则u在线性序列中出现在v之前。通常,这样的线性序列称为满足拓扑次序 (Topological Order)的序列,简称拓扑序列。简单的说,由某个集合上的一个偏序得到该集合上的一个全序,这个...

wait 1万+

STM32H7 FMC驱动TFT-LCD原理与实战

TFT-LCD并行接口驱动是嵌入式人机交互的基础技术,其核心在于将显示控制器抽象为存储器映射设备,依托硬件时序控制器实现低开销、高确定性刷新。FMC(Flexible Memory Controller)作为STM32H7系列的关键外设,通过地址/数据总线复用、可配置读写时序及Bank分区机制,支持将ILI9341、ST7789等主流LCD控制器挂载为‘慢速异步存储器’,从而替代GPIO模拟8080时序或LTDC+DMA2D方案。该技术显著降低CPU占用率,提升帧率稳定性,适用于工业HMI、实时仪表盘等对响

weixin_32306683的博客 550

浅谈拓扑排序(模板+例题)

所谓拓扑排序就是对一个有向无环图G进行拓扑排序,是将G中所有顶点排成一个线性序列,使得图中任意一对顶点u和v,若边<u,v>∈E(G),则u在线性序列中出现在v之前。 可能这个定义有点难理解,那接下来我就说说它的具体流程。(真的容易理解的) 进入正题 随便的给你一个有向无环图 1:找到入度为0的点 就像此图,它入度为0的点是1和4,将它们取出来,记为第一个数和第二个数。并且把与它们有关的边都去掉(这个图就没有哈) 2:重复上述操作。 取出入度为0的点,现在入度为0的点是2,

wcqqq的博客 4044

用Python和sklearn预测NBA比赛胜负:从数据清洗到模型优化的完整流程

本文详细介绍了如何使用Python和sklearn构建NBA比赛胜负预测模型,涵盖从数据清洗、特征工程到模型优化与部署的完整流程。通过对比随机森林、XGBoost等主流算法,提供实战技巧和解决方案,帮助数据爱好者掌握体育数据分析的核心技术。

weixin_30823001的博客 139

告别QWebEngineView!用QtLocation+SQLite打造离线地图应用(附完整源码)

本文详细介绍了如何利用QtLocation模块与SQLite数据库构建高性能离线地图引擎,解决传统QWebEngineView方案在网络依赖、内存占用和定制化方面的不足。通过多级缓存机制、异步写入优化和纹理压缩技术,实现工业级应用的稳定运行和高效渲染,特别适合车载导航和野外勘探等场景。

weixin_30431445的博客 365

图论模板(拓扑排序、最短路)

图论模板一、拓扑排序题意代码二、Dijkstra题意代码1(朴素版)代码2(堆优化版)2.读入数据总结 一、拓扑排序 题意 输出拓扑排序,如果不存在输出-1. 代码 void topsort() { queue<int> que; for(int i=1;i<=n;i++) if(!din[i]) que.push(i), ans[++num] = i; while(que.size()){ int t = que.fron

心升明月的博客 942

(Touch™)搭建 Windows 开发环境

> OpenHaptics 开发包参考文档。

置心一处,便无事不办 1503

拓扑排序 (算法思想+图解+模板+练习题)

如果是一个有向无环图,那么一定有一个点的入度为0,如果找不到一个入度为0的点,这个图一定是带环的。将队列里的点依次出队列,然后找出所有出队列这个点发出的边,删除边,同时边的另一侧的点的入度 -1。对于有向图每个结点都有入度和出度,入度就是指向该结点的边数,出度就是该结点指向其他结点的边数。一个有向图,如果图中有入度为 0 的点,就把这个点删掉,同时也删掉这个点所连的边。然后D的入度为0,我们同样操作,最后图被删除干净,证明可以拓扑排序。总结一下拓扑排序就是只有从前指向后的边,没有从后指向前的边。

暴躁小吕的博客 3万+

Windows 11 安装 JDK 25:下载、安装、配置环境变量、验证

本文详细介绍了在 Windows 11 系统上安装 JDK 25 的完整流程,包括从 Oracle 官网下载压缩包、解压至自定义目录、配置 JAVA_HOME 与 Path 环境变量,并验证安装是否成功。文章推荐使用 ZIP 压缩包而非 EXE 安装程序,以实现绿色便携、多版本共存和灵活管理。最后通过一个使用 Java 25 新特性的示例程序,验证 JDK 的编译与运行环境。

寒水馨 · 轻量级技术文档 · hanshuixin.org 7728

手把手教你学Simulink——基于Simulink的机械臂正运动学仿真建模示例

机械臂正运动学概述正运动学的核心在于根据每个关节的角度值,通过坐标变换(如DH参数法或齐次变换矩阵)计算出末端执行器相对于基座的位置和姿态。常用的数学工具包括旋转矩阵、平移向量以及它们组合而成的齐次变换矩阵。仿真目标设计并实现一个机械臂正运动学模型。输入关节角度,输出末端执行器的位置和姿态。分析不同关节角度下的机械臂位置变化。假设我们有一个简单的3自由度(DOF)平面机械臂,其各关节的长度分别为l1l1​、l2l2​和l3l3​。在Simulink中,可以使用。

MHD0815的博客 362

拓扑排序【模板】

来源:牛客网。

CSDN2151530018的博客 845

基于Simulink进行光伏逆变器效率分析的仿真建模

特点能量转换:将光伏电池板产生的直流电转换为交流电。效率评估:分析逆变器在不同负载条件和环境条件下的效率。动态特性:考虑温度、光照强度等外部因素对逆变器效率的影响。挑战精确建模:准确地模拟光伏电池板、逆变器及其交互的动力学过程。多因素考量:需要同时考虑输入电压、电流、温度、光照强度等多种因素对逆变器效率的影响。集成度:需要与其他系统(如最大功率点跟踪MPPT算法、电网连接等)无缝集成,以实现全面的系统分析。首先明确要模拟的任务内容。输入条件(如光照强度、温度等)。

amy_mhd的博客 144

【裸的拓扑排序模板题】Legal or Not

文章目录题目描述代码实现码后反思 题目描述 裸的拓扑排序 代码实现 //拓扑排序模板题 #include <cstdio> #include <queue> #include <vector> #include <algorithm> using namespace std; const int maxn = 110; int n,m; int ind[maxn]; //入度表示有徒弟 vector<int> adj[maxn]; vo.

yc_cy1999的博客 199

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

HDU - 3342 Legal or Not(拓扑排序模板)

ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many “holy cows” like HH, hh, AC, ZT, lcc, BF, Qinz and so on chat on-l...

王蒟蒻 179

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Legal or Not(HDU 3342)---拓扑排序模板题

题目链接 题目描述 ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many “holy cows” like HH, hh, AC, ZT, lcc, BF, Qinz and so...

weixin_43960284的博客 194

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

HDU3342(Legal or Not)

题目传送门 思路 这题比较简单一个裸的拓扑排序模板题,只要有拓扑序生成关系就一定正确。 #include <iostream> #include <cstring> #include <queue> #include <cstdio> #include <algorithm> using namespace std; const int...

weixin_43808717的博客 209

HDU3342 Legal or Not——拓扑排序(裸题)

点这里 题意: n个人和m对人机关系,每对人机关系x、y表示x是y的师傅。人机关系具有传递性,即我的师傅的师傅也是我的师傅,我的徒弟的徒弟也是我的徒弟。要求找出人际关系中是否含有不合法的,即如果出现某个人既是我的师傅,也是我的徒弟,则关系不合法,输出NO,全都合法输出YES。 题解: 刚看题意觉得新鲜,其实就是拓扑排序的裸题,按照拓扑排序的模板走完,如果还要人的入度不为0,说明内部构成了循环,而构成循环的原因就是出现了不合法的关系。 #include<bits/stdc++.h> using

lllllan 343

HDU-3342-Legal or Not

HDU-3342-Legal or Not 传送门 这道题拓扑排序模板。bfs嘻嘻 题目大意:背景是一个人题目问题的叫做master…帮他解决问题的叫做prentice。这样会构成一对关系。 题目每组给出m种关系。判断是否合法。 这种关系具有传递性。 即A是B的prentice, B是C的prentice。那么A也是C的prentice. 判断合法的依据是:A是B的prentice的时候,B不能是...

qq_44624316的博客 917

Legal or Not HDU - 3342

hdu - 3342   是一道拓扑排序的模板题,用queue来维护,in数组来保存每个点的入度,mapp数用来建邻接矩阵,用bfs实现。   这道题要注意判重边,否则in数组会出错   具体见代码注释 #include<iostream> #include<queue> #include<cstring> #include<cstdio> #inc...

qq_43560101的博客 151

HDU-3342 Legal or Not(拓扑排序)

看题的时候第一反应是并查集,想写但是20天就忘光了并查集(还是需要好好练习),找模板的过程中反应过来无法表示,只能老实的写拓扑排序 一次AC,用的书上讲的栈方法实现,又是31ms,大家的效率好高,然后看见讨论版有人说会卡重边,不知道为什么会卡住...

idealism_xxm的专栏 449

HDU3342Legal or No(拓扑排序判环)

题目链接:HDU3342 题目大意:给一个n个点m条边的有向关系图,问这图中是否存在环,即判断是否是DAG 。 解题思路:拓扑排序判环模板题 AC代码: #include &lt;cstdio&gt; #include &lt;cstring&gt; #include &lt;cstdlib&gt; #include &lt;cmath&gt; #include &lt;iostream&gt;...

小胡同的诗 577

HDU 3342 Legal or Not(拓扑排序)

Legal or Not Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7133    Accepted Submission(s): 3400 Problem Description ACM-DIY is a

学 以致用 233

算法模板之拓扑排序(HDU 3342 Legal or Not)

模板总结归纳://拓扑排序 //O(|V| + |E|) const int maxn = 1e5+5; vector &lt;int&gt; g[maxn]; int du[maxn], n, m, L[maxn]; // L储存拓扑排序结果 bool topsort(){ memset(du, 0, sizeof(du)); for(int i = 0; i &lt; n; i++...

摸不着脑子的博客 270

【拓扑排序】HDOJ 3342 Legal or Not

Legal or NotTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10349    Accepted Submission(s): 4844Problem DescriptionACM-DIY is a large QQ group ...

cym的博客 269

【HDU】3342 Legal or Not 拓扑排序

Legal or Not Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3988    Accepted Submission(s): 1793 Problem Description ACM-DIY is a

poursoul 719
上一篇: 【模板】最小生成树(MST)(连接计算机、还是畅通工程题解)
下一篇: 【模板】比较大小之重载运算符和重写cmp (大整数排序、Excel排序、开门人和关门人题解)
coderwait
博客等级 码龄9年 20粉丝 210原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址