<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=2282_-_Componente_Conexe_4</id>
	<title>2282 - Componente Conexe 4 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=2282_-_Componente_Conexe_4"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2282_-_Componente_Conexe_4&amp;action=history"/>
	<updated>2026-05-01T06:36:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=2282_-_Componente_Conexe_4&amp;diff=7979&amp;oldid=prev</id>
		<title>Simina: Pagină nouă: == Enunț == Se consideră un graf neorientat cu &lt;code&gt;n&lt;/code&gt; vârfuri și &lt;code&gt;m&lt;/code&gt; muchii. Cele &lt;code&gt;m&lt;/code&gt; muchii se elimină pe rând din graf.  = Cerința = Pentru fiecare muchie eliminată trebuie să spuneți câte componente conexe are graful.  = Date de intrare = Programul citește de la tastatură numerele &lt;code&gt;n&lt;/code&gt; și &lt;code&gt;m&lt;/code&gt;, iar pe următoarele &lt;code&gt;m&lt;/code&gt; linii se află câte două valori &lt;code&gt;x&lt;/code&gt; și &lt;code&gt;y&lt;/code&gt; separate prin...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2282_-_Componente_Conexe_4&amp;diff=7979&amp;oldid=prev"/>
		<updated>2023-12-13T12:10:15Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: == Enunț == Se consideră un graf neorientat cu &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; vârfuri și &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; muchii. Cele &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; muchii se elimină pe rând din graf.  = Cerința = Pentru fiecare muchie eliminată trebuie să spuneți câte componente conexe are graful.  = Date de intrare = Programul citește de la tastatură numerele &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; și &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt;, iar pe următoarele &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; linii se află câte două valori &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; și &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; separate prin...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Enunț ==&lt;br /&gt;
Se consideră un graf neorientat cu &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; vârfuri și &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; muchii. Cele &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; muchii se elimină pe rând din graf.&lt;br /&gt;
&lt;br /&gt;
= Cerința =&lt;br /&gt;
Pentru fiecare muchie eliminată trebuie să spuneți câte componente conexe are graful.&lt;br /&gt;
&lt;br /&gt;
= Date de intrare =&lt;br /&gt;
Programul citește de la tastatură numerele &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; și &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt;, iar pe următoarele &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; linii se află câte două valori &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; și &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; separate prin spațiu, reprezentând o muchie din graf. Muchiile vi se dau în ordinea în care ele se elimină din graf.&lt;br /&gt;
&lt;br /&gt;
= Date de ieșire =&lt;br /&gt;
Programul va afișa pe ecran exact &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; linii, pe fiecare linie &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; aflându-se un singur număr natural reprezentând numărul componentelor conexe din graf după eliminarea celei de-a &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;-a muchii.&lt;br /&gt;
&lt;br /&gt;
= Restricții și precizări =&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1 ≤ n ≤ 100 000&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;1 ≤ m ≤ 500 000&amp;lt;/code&amp;gt;&lt;br /&gt;
* Între două vârfuri va exista cel mult o muchie&lt;br /&gt;
&lt;br /&gt;
= Exemplul 1 =&lt;br /&gt;
Intrare&lt;br /&gt;
 5 6&lt;br /&gt;
 1 2&lt;br /&gt;
 3 4&lt;br /&gt;
 2 3&lt;br /&gt;
 1 5&lt;br /&gt;
 5 4&lt;br /&gt;
 4 1&lt;br /&gt;
Ieșire&lt;br /&gt;
 1&lt;br /&gt;
 2&lt;br /&gt;
 3&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
 5&lt;br /&gt;
&lt;br /&gt;
=== Explicație ===&lt;br /&gt;
Sunt &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt; vârfuri și &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; muchii. Urmează cele &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; muchii în ordinea eliminării lor. După eliminarea muchiei &amp;lt;code&amp;gt;1 2&amp;lt;/code&amp;gt; graful este tot conex, deci rezultatul este &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. După eliminarea muchiei &amp;lt;code&amp;gt;3 4&amp;lt;/code&amp;gt; se obțin două componente conexe, una formată din vârfurile &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;, iar cealaltă componentă formată din vârfurile &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;. Restul eliminărilor nu mai trebuie explicate că ați înțeles deja.&lt;br /&gt;
&lt;br /&gt;
== Exemplul 1 ==&lt;br /&gt;
Intrare&lt;br /&gt;
 1000000000 10000000000&lt;br /&gt;
consola&lt;br /&gt;
 Datele nu corespund restrictiilor impuse&lt;/div&gt;</summary>
		<author><name>Simina</name></author>
	</entry>
</feed>