<?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=3201_-_IJK</id>
	<title>3201 - IJK - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=3201_-_IJK"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3201_-_IJK&amp;action=history"/>
	<updated>2026-05-01T11:47:09Z</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=3201_-_IJK&amp;diff=9037&amp;oldid=prev</id>
		<title>Benea Coralia at 22:43, 4 January 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3201_-_IJK&amp;diff=9037&amp;oldid=prev"/>
		<updated>2024-01-04T22:43:13Z</updated>

		<summary type="html">&lt;p&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 22:43, 4 January 2024&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-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&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;Fișierul de ieșire &amp;#039;&amp;#039;&amp;#039;ijk.out&amp;#039;&amp;#039;&amp;#039; va conține pe prima linie numărul tripletelor &amp;#039;&amp;#039;&amp;#039;(i,j,k)&amp;#039;&amp;#039;&amp;#039;, cu &amp;#039;&amp;#039;&amp;#039;1 &amp;amp;les; i &amp;lt; j &amp;lt; k &amp;amp;les; n&amp;#039;&amp;#039;&amp;#039;, pentru care avem &amp;#039;&amp;#039;&amp;#039;a[i] &amp;gt; a[j] &amp;lt; a[k]&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&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;Fișierul de ieșire &amp;#039;&amp;#039;&amp;#039;ijk.out&amp;#039;&amp;#039;&amp;#039; va conține pe prima linie numărul tripletelor &amp;#039;&amp;#039;&amp;#039;(i,j,k)&amp;#039;&amp;#039;&amp;#039;, cu &amp;#039;&amp;#039;&amp;#039;1 &amp;amp;les; i &amp;lt; j &amp;lt; k &amp;amp;les; n&amp;#039;&amp;#039;&amp;#039;, pentru care avem &amp;#039;&amp;#039;&amp;#039;a[i] &amp;gt; a[j] &amp;lt; a[k]&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&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;== Restricţii şi precizări ==&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;== Restricţii şi precizări ==&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;&#039;&#039;&#039;3 &amp;amp;les; n &amp;amp;les; 70.000&#039;&#039;&#039;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*&lt;/ins&gt;&#039;&#039;&#039;3 &amp;amp;les; n &amp;amp;les; 70.000&#039;&#039;&#039;&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 de pe a doua linie a fișierului de intrare vor fi mai mici decât &#039;&#039;&#039;2.000.000.000&#039;&#039;&#039;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*&lt;/ins&gt;numerele de pe a doua linie a fișierului de intrare vor fi mai mici decât &#039;&#039;&#039;2.000.000.000&#039;&#039;&#039;&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;== Exemplul 1 ==&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;== Exemplul 1 ==&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;; ijkin.txt&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;; ijkin.txt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Benea Coralia</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=3201_-_IJK&amp;diff=9027&amp;oldid=prev</id>
		<title>Benea Coralia: Pagină nouă: == Cerinţa == Se dă un şir a cu n numere naturale. Aflaţi numărul tripletelor &#039;&#039;&#039;(i,j,k)&#039;&#039;&#039;, cu &#039;&#039;&#039;1 ≤ i &lt; j &lt; k ≤ n,&#039;&#039;&#039; pentru care avem &#039;&#039;&#039;a[i] &gt; a[j] &lt; a[k].&#039;&#039;&#039; == Date de intrare == Fișierul de intrare &#039;&#039;&#039;ijk.in&#039;&#039;&#039; conține pe prima linie numărul &#039;&#039;&#039;n&#039;&#039;&#039;, iar pe a doua linie &#039;&#039;&#039;n&#039;&#039;&#039; numere naturale separate prin spații. == Date de ieșire == Fișierul de ieșire &#039;&#039;&#039;ijk.out&#039;&#039;&#039; va conține pe prima linie numărul tripletelor &#039;&#039;&#039;(i,j,k)&#039;&#039;&#039;, cu &#039;&#039;&#039;1 &amp;les; i &lt; j &lt;...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3201_-_IJK&amp;diff=9027&amp;oldid=prev"/>
		<updated>2024-01-04T21:55:39Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: == Cerinţa == Se dă un şir a cu n numere naturale. Aflaţi numărul tripletelor &amp;#039;&amp;#039;&amp;#039;(i,j,k)&amp;#039;&amp;#039;&amp;#039;, cu &amp;#039;&amp;#039;&amp;#039;1 ≤ i &amp;lt; j &amp;lt; k ≤ n,&amp;#039;&amp;#039;&amp;#039; pentru care avem &amp;#039;&amp;#039;&amp;#039;a[i] &amp;gt; a[j] &amp;lt; a[k].&amp;#039;&amp;#039;&amp;#039; == Date de intrare == Fișierul de intrare &amp;#039;&amp;#039;&amp;#039;ijk.in&amp;#039;&amp;#039;&amp;#039; conține pe prima linie numărul &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039;, iar pe a doua linie &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; numere naturale separate prin spații. == Date de ieșire == Fișierul de ieșire &amp;#039;&amp;#039;&amp;#039;ijk.out&amp;#039;&amp;#039;&amp;#039; va conține pe prima linie numărul tripletelor &amp;#039;&amp;#039;&amp;#039;(i,j,k)&amp;#039;&amp;#039;&amp;#039;, cu &amp;#039;&amp;#039;&amp;#039;1 ⩽ i &amp;lt; j &amp;lt;...&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;
Se dă un şir a cu n numere naturale. Aflaţi numărul tripletelor &amp;#039;&amp;#039;&amp;#039;(i,j,k)&amp;#039;&amp;#039;&amp;#039;, cu &amp;#039;&amp;#039;&amp;#039;1 ≤ i &amp;lt; j &amp;lt; k ≤ n,&amp;#039;&amp;#039;&amp;#039; pentru care avem &amp;#039;&amp;#039;&amp;#039;a[i] &amp;gt; a[j] &amp;lt; a[k].&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
Fișierul de intrare &amp;#039;&amp;#039;&amp;#039;ijk.in&amp;#039;&amp;#039;&amp;#039; conține pe prima linie numărul &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039;, iar pe a doua linie &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; numere naturale separate prin spații.&lt;br /&gt;
== Date de ieșire ==&lt;br /&gt;
Fișierul de ieșire &amp;#039;&amp;#039;&amp;#039;ijk.out&amp;#039;&amp;#039;&amp;#039; va conține pe prima linie numărul tripletelor &amp;#039;&amp;#039;&amp;#039;(i,j,k)&amp;#039;&amp;#039;&amp;#039;, cu &amp;#039;&amp;#039;&amp;#039;1 &amp;amp;les; i &amp;lt; j &amp;lt; k &amp;amp;les; n&amp;#039;&amp;#039;&amp;#039;, pentru care avem &amp;#039;&amp;#039;&amp;#039;a[i] &amp;gt; a[j] &amp;lt; a[k]&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
== Restricţii şi precizări ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;3 &amp;amp;les; n &amp;amp;les; 70.000&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
numerele de pe a doua linie a fișierului de intrare vor fi mai mici decât &amp;#039;&amp;#039;&amp;#039;2.000.000.000&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
== Exemplul 1 ==&lt;br /&gt;
; ijkin.txt&lt;br /&gt;
 5&lt;br /&gt;
 3 11 2 7 14&lt;br /&gt;
; ijkout.txt&lt;br /&gt;
 5&lt;br /&gt;
== Explicatie ==&lt;br /&gt;
Tripletele cu proprietatea cerută sunt: &amp;#039;&amp;#039;&amp;#039;(1,3,4)&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;(1,3,5)&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;(2,3,4)&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;(2,3,5)&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;(2,4,5)&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
== Exemplul 2 ==&lt;br /&gt;
; ijkin.txt&lt;br /&gt;
 1&lt;br /&gt;
 1000000000&lt;br /&gt;
; ijkout.txt&lt;br /&gt;
 Datele de intrare nu corespund restrictiilor impuse&lt;br /&gt;
== Rezolvare ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
def verifica_restrictii(n, a):&lt;br /&gt;
    if n &amp;lt; 3 or n &amp;gt; 70000:&lt;br /&gt;
        return False&lt;br /&gt;
    for numar in a:&lt;br /&gt;
        if numar &amp;lt; 0 or numar &amp;gt;= 2000000000:&lt;br /&gt;
            return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
def calculeaza_triplete(n, a):&lt;br /&gt;
    numar_triplete = 0&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        for j in range(i + 1, n):&lt;br /&gt;
            for k in range(j + 1, n):&lt;br /&gt;
                if a[i] &amp;gt; a[j] and a[j] &amp;lt; a[k]:&lt;br /&gt;
                    numar_triplete += 1&lt;br /&gt;
    return numar_triplete&lt;br /&gt;
&lt;br /&gt;
def rezolva_problema():&lt;br /&gt;
    with open(&amp;#039;ijkin.txt&amp;#039;, &amp;#039;r&amp;#039;) as fisier_intrare:&lt;br /&gt;
        n = int(fisier_intrare.readline())&lt;br /&gt;
        a = list(map(int, fisier_intrare.readline().split()))&lt;br /&gt;
&lt;br /&gt;
    if verifica_restrictii(n, a):&lt;br /&gt;
        print(&amp;quot;Datele de intrare corespund restrictiilor impuse&amp;quot;)&lt;br /&gt;
        numar_triplete = calculeaza_triplete(n, a)&lt;br /&gt;
&lt;br /&gt;
        with open(&amp;#039;ijkout.txt&amp;#039;, &amp;#039;w&amp;#039;) as fisier_iesire:&lt;br /&gt;
            fisier_iesire.write(str(numar_triplete))&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Datele de intrare nu corespund restrictiilor impuse&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
rezolva_problema()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Benea Coralia</name></author>
	</entry>
</feed>