<?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=1374_-_numere9</id>
	<title>1374 - numere9 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=1374_-_numere9"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1374_-_numere9&amp;action=history"/>
	<updated>2026-05-01T11:45:42Z</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=1374_-_numere9&amp;diff=5480&amp;oldid=prev</id>
		<title>Sovago Rares-Andrei: /* Cerința */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1374_-_numere9&amp;diff=5480&amp;oldid=prev"/>
		<updated>2023-04-29T15:47:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Cerința&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:47, 29 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Cerința==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Cerința==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Mircea este pasionat de programare. El a început să rezolve probleme din ce în ce mai grele. Astfel a ajuns la o problemă, care are ca date de intrare un tablou pătratic cu n linii şi n coloane, componente tabloului fiind toate numerele naturale distincte de la 1 la &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;n2&lt;/del&gt;. Pentru a verifica programul pe care l-a scris îi trebuie un fişier care să conţină tabloul respectiv. După ce a creat acest fişier, fratele său, pus pe şotii îi umblă în fişier şi îi schimbă câteva numere consecutive, cu numărul 0. Când se întoarce Mircea de la joacă constată cu stupoare că nu îi merge programul pentru testul respectiv. După câteva ore de depanare îşi dă seama că programul lui este corect şi că fişierul de intrare are probleme.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Mircea este pasionat de programare. El a început să rezolve probleme din ce în ce mai grele. Astfel a ajuns la o problemă, care are ca date de intrare un tablou pătratic cu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;linii şi &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;coloane, componente tabloului fiind toate numerele naturale distincte de la &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;1 la &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;n^2&#039;&#039;&#039;&lt;/ins&gt;. Pentru a verifica programul pe care l-a scris îi trebuie un fişier care să conţină tabloul respectiv. După ce a creat acest fişier, fratele său, pus pe şotii îi umblă în fişier şi îi schimbă câteva numere consecutive, cu numărul 0. Când se întoarce Mircea de la joacă constată cu stupoare că nu îi merge programul pentru testul respectiv. După câteva ore de depanare îşi dă seama că programul lui este corect şi că fişierul de intrare are probleme.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Scrieţi un program care să-l ajute pe Mircea, găsindu-i cel mai mic şi cel mai mare dintre numerele consecutive schimbate de fratele său.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Scrieţi un program care să-l ajute pe Mircea, găsindu-i cel mai mic şi cel mai mare dintre numerele consecutive schimbate de fratele său.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Date de intrare ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Date de intrare ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sovago Rares-Andrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1374_-_numere9&amp;diff=5478&amp;oldid=prev</id>
		<title>Sovago Rares-Andrei: /* Restricţii şi precizări */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1374_-_numere9&amp;diff=5478&amp;oldid=prev"/>
		<updated>2023-04-29T15:45:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Restricţii şi precizări&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:45, 29 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l16&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*0&amp;lt;n≤500&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*0&amp;lt;n≤500&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Fratele lui Mircea schimbă cel puţin un număr în fişier.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Fratele lui Mircea schimbă cel puţin un număr în fişier.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Numerele schimbate de fratele lui Mircea sunt mai mici sau cel mult egale cu 60000.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Numerele schimbate de fratele lui Mircea sunt mai mici sau cel mult egale cu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;60000&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Exemple ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Exemple ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sovago Rares-Andrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1374_-_numere9&amp;diff=3598&amp;oldid=prev</id>
		<title>Sovago Rares-Andrei: Pagină nouă: ==Cerința==  Mircea este pasionat de programare. El a început să rezolve probleme din ce în ce mai grele. Astfel a ajuns la o problemă, care are ca date de intrare un tablou pătratic cu n linii şi n coloane, componente tabloului fiind toate numerele naturale distincte de la 1 la n2. Pentru a verifica programul pe care l-a scris îi trebuie un fişier care să conţină tabloul respectiv. După ce a creat acest fişier, fratele său, pus pe şotii îi umblă în fişier...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1374_-_numere9&amp;diff=3598&amp;oldid=prev"/>
		<updated>2023-04-14T16:04:58Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: ==Cerința==  Mircea este pasionat de programare. El a început să rezolve probleme din ce în ce mai grele. Astfel a ajuns la o problemă, care are ca date de intrare un tablou pătratic cu n linii şi n coloane, componente tabloului fiind toate numerele naturale distincte de la 1 la n2. Pentru a verifica programul pe care l-a scris îi trebuie un fişier care să conţină tabloul respectiv. După ce a creat acest fişier, fratele său, pus pe şotii îi umblă în fişier...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Cerința==&lt;br /&gt;
&lt;br /&gt;
Mircea este pasionat de programare. El a început să rezolve probleme din ce în ce mai grele. Astfel a ajuns la o problemă, care are ca date de intrare un tablou pătratic cu n linii şi n coloane, componente tabloului fiind toate numerele naturale distincte de la 1 la n2. Pentru a verifica programul pe care l-a scris îi trebuie un fişier care să conţină tabloul respectiv. După ce a creat acest fişier, fratele său, pus pe şotii îi umblă în fişier şi îi schimbă câteva numere consecutive, cu numărul 0. Când se întoarce Mircea de la joacă constată cu stupoare că nu îi merge programul pentru testul respectiv. După câteva ore de depanare îşi dă seama că programul lui este corect şi că fişierul de intrare are probleme.&lt;br /&gt;
&lt;br /&gt;
Scrieţi un program care să-l ajute pe Mircea, găsindu-i cel mai mic şi cel mai mare dintre numerele consecutive schimbate de fratele său.&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
&lt;br /&gt;
În fişierul &amp;#039;&amp;#039;&amp;#039;numere9.in&amp;#039;&amp;#039;&amp;#039; se dă pe prima linie n, iar pe următoarele n linii elementele tabloului, câte n elemente pe o linie, separate între ele prin câte un spaţiu, după modificările făcute de fratele lui Mircea.&lt;br /&gt;
&lt;br /&gt;
== Date de ieșire ==&lt;br /&gt;
&lt;br /&gt;
Dacă datele sunt introduse corect, pe ecran se va afișa: &amp;quot;Datele sunt introduse corect.&amp;quot; În fişierul &amp;#039;&amp;#039;&amp;#039;numere9.out&amp;#039;&amp;#039;&amp;#039; se va scrie pe un singur rând cu un singur spaţiu între ele numerele cerute (primul fiind cel mai mic).&lt;br /&gt;
&lt;br /&gt;
În cazul în care datele nu respectă restricțiile, se va afișa: &amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;.&lt;br /&gt;
== Restricţii şi precizări ==&lt;br /&gt;
*0&amp;lt;n≤500&lt;br /&gt;
*Fratele lui Mircea schimbă cel puţin un număr în fişier.&lt;br /&gt;
*Numerele schimbate de fratele lui Mircea sunt mai mici sau cel mult egale cu 60000.&lt;br /&gt;
&lt;br /&gt;
== Exemple ==&lt;br /&gt;
===Exemplul 1===&lt;br /&gt;
; &amp;#039;&amp;#039;numere9.in&amp;#039;&amp;#039;&lt;br /&gt;
:3&lt;br /&gt;
:5 0 7&lt;br /&gt;
:0 0 1&lt;br /&gt;
:6 9 8&lt;br /&gt;
; &amp;#039;&amp;#039;ecran&amp;#039;&amp;#039;&lt;br /&gt;
:Datele sunt introduse corect.&lt;br /&gt;
; &amp;#039;&amp;#039;numere9.out&amp;#039;&amp;#039;&lt;br /&gt;
:6 9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exemplul 2===&lt;br /&gt;
; &amp;#039;&amp;#039;numere9.in&amp;#039;&amp;#039;&lt;br /&gt;
:3&lt;br /&gt;
:2 3 1&lt;br /&gt;
:7 5 4&lt;br /&gt;
:8 0 6&lt;br /&gt;
; &amp;#039;&amp;#039;ecran&amp;#039;&amp;#039;&lt;br /&gt;
:Datele sunt introduse corect.&lt;br /&gt;
; &amp;#039;&amp;#039;numere9.out&amp;#039;&amp;#039;&lt;br /&gt;
:1 7 &lt;br /&gt;
&lt;br /&gt;
===Exemplul 3===&lt;br /&gt;
; &amp;#039;&amp;#039;numere9.in&amp;#039;&amp;#039;&lt;br /&gt;
:2&lt;br /&gt;
:4 5&lt;br /&gt;
:1&lt;br /&gt;
; &amp;#039;&amp;#039;ecran&amp;#039;&amp;#039;&lt;br /&gt;
:Datele nu corespund restricțiilor impuse.&lt;br /&gt;
; &amp;#039;&amp;#039;numere9.out&amp;#039;&amp;#039;&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rezolvare == &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
# 1374 - numere9&lt;br /&gt;
def validate_input(n: int, matrix: list[list[int]]) -&amp;gt; bool:&lt;br /&gt;
    if not 0 &amp;lt; n &amp;lt;= 500:&lt;br /&gt;
        print(&amp;quot;Error: The size of the matrix must be between 1 and 500.&amp;quot;)&lt;br /&gt;
        return False&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        for j in range(n):&lt;br /&gt;
            if not 0 &amp;lt;= matrix[i][j] &amp;lt;= 60000:&lt;br /&gt;
                print(f&amp;quot;Error: Invalid number &amp;#039;{matrix[i][j]}&amp;#039; at line {i+2}, column {j+1}.&amp;quot;)&lt;br /&gt;
                return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
def find_changed_numbers(n: int, matrix: list[list[int]]) -&amp;gt; tuple[int, int]:&lt;br /&gt;
    min_changed, max_changed = float(&amp;#039;inf&amp;#039;), float(&amp;#039;-inf&amp;#039;)&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        for j in range(n-1):&lt;br /&gt;
            if matrix[i][j] == 0 or matrix[i][j+1] == 0:&lt;br /&gt;
                continue&lt;br /&gt;
            elif abs(matrix[i][j+1] - matrix[i][j]) &amp;gt; 1:&lt;br /&gt;
                min_changed = min(min_changed, matrix[i][j], matrix[i][j+1])&lt;br /&gt;
                max_changed = max(max_changed, matrix[i][j], matrix[i][j+1])&lt;br /&gt;
    return (min_changed, max_changed)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
    try:&lt;br /&gt;
        with open(&amp;#039;numere9.in&amp;#039;, &amp;#039;r&amp;#039;) as f:&lt;br /&gt;
            n = int(f.readline())&lt;br /&gt;
            matrix = []&lt;br /&gt;
            for i in range(n):&lt;br /&gt;
                row = list(map(int, f.readline().split()))&lt;br /&gt;
                if len(row) != n:&lt;br /&gt;
                    raise ValueError(&amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
                matrix.append(row)&lt;br /&gt;
            if len(matrix) != n:&lt;br /&gt;
                raise ValueError(&amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
        if validate_input(n, matrix):&lt;br /&gt;
            smallest, largest = find_changed_numbers(n, matrix)&lt;br /&gt;
            with open(&amp;#039;numere9.out&amp;#039;, &amp;#039;w&amp;#039;) as f:&lt;br /&gt;
                f.write(f&amp;quot;{smallest} {largest}&amp;quot;)&lt;br /&gt;
            print(&amp;quot;Datele sunt introduse corect.&amp;quot;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;, file=sys.stderr)&lt;br /&gt;
            sys.exit(1)&lt;br /&gt;
    except Exception as e:&lt;br /&gt;
        print(&amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Explicatie==&lt;br /&gt;
&lt;br /&gt;
validate_input(n, matrix) -&amp;gt; bool&lt;br /&gt;
Aceasta functie primeste dimensiunea matricei n si matricea propriu-zisa matrix si verifica daca datele sunt valide sau nu. Functia intoarce True daca datele sunt valide si False altfel. Mai exact, functia verifica daca:&lt;br /&gt;
&lt;br /&gt;
n este mai mare decat 0 si mai mic sau egal cu 500;&lt;br /&gt;
matricea matrix contine exact n linii si fiecare linie contine exact n elemente;&lt;br /&gt;
fiecare element din matricea matrix este mai mare sau egal cu 1 si mai mic sau egal cu 60000.&lt;br /&gt;
find_changed_numbers(n, matrix) -&amp;gt; tuple&lt;br /&gt;
Aceasta functie primeste dimensiunea matricei n si matricea propriu-zisa matrix si identifica cele mai mici si cele mai mari numere consecutive schimbate din matrice. Functia intoarce cele doua numere ca o pereche de valori. Mai exact, functia:&lt;br /&gt;
&lt;br /&gt;
parcurge fiecare linie a matricei matrix;&lt;br /&gt;
compara fiecare element dintr-o linie cu elementul urmator din aceeasi linie;&lt;br /&gt;
daca diferenta dintre cele doua elemente este mai mare decat 1, atunci cele doua elemente formeaza o pereche de numere consecutive schimbate;&lt;br /&gt;
se tine evidenta celor mai mici si celor mai mari numere din astfel de perechi;&lt;br /&gt;
cele mai mici si cele mai mari numere sunt intoarse sub forma de o pereche de valori.&lt;br /&gt;
main()&lt;br /&gt;
Aceasta functie citeste datele de intrare din fisierul &amp;quot;numere9.in&amp;quot;, verifica daca datele sunt valide prin apelul functiei validate_input, identifica cele mai mici si cele mai mari numere consecutive schimbate prin apelul functiei find_changed_numbers, scrie cele doua numere in fisierul de iesire &amp;quot;numere9.out&amp;quot; si afiseaza un mesaj de confirmare a validitatii datelor daca datele sunt valide sau afiseaza un mesaj de eroare daca datele nu sunt valide.&lt;/div&gt;</summary>
		<author><name>Sovago Rares-Andrei</name></author>
	</entry>
</feed>