summaryrefslogtreecommitdiffstats
path: root/šola
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-06-04 15:40:40 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-06-04 15:40:40 +0200
commit1d0e0e54f663920a0992f1af5bd7d0b37eee537a (patch)
tree240a15da83a020bbd8b0ba294db20f45308a52c0 /šola
parentMerge branch 'master' of ssh://ni.4a.si/var/lib/git/sijanec/r (diff)
downloadr-1d0e0e54f663920a0992f1af5bd7d0b37eee537a.tar
r-1d0e0e54f663920a0992f1af5bd7d0b37eee537a.tar.gz
r-1d0e0e54f663920a0992f1af5bd7d0b37eee537a.tar.bz2
r-1d0e0e54f663920a0992f1af5bd7d0b37eee537a.tar.lz
r-1d0e0e54f663920a0992f1af5bd7d0b37eee537a.tar.xz
r-1d0e0e54f663920a0992f1af5bd7d0b37eee537a.tar.zst
r-1d0e0e54f663920a0992f1af5bd7d0b37eee537a.zip
Diffstat (limited to 'šola')
-rw-r--r--šola/ds2/teor.lyx24
-rw-r--r--šola/p2/dn/DN09b_63230317.c48
2 files changed, 59 insertions, 13 deletions
diff --git a/šola/ds2/teor.lyx b/šola/ds2/teor.lyx
index c0fe332..2d03ffc 100644
--- a/šola/ds2/teor.lyx
+++ b/šola/ds2/teor.lyx
@@ -431,13 +431,10 @@ S
, kot to naredi
\family typewriter
-bash
-\end_layout
-
-\end_inset
-
-.
- Nekateri bi
+bash.
+
+\family default
+Nekateri bi
\begin_inset Formula $\left\{ 1..n\right\} $
\end_inset
@@ -445,7 +442,12 @@ bash
\begin_inset Formula $\left[n\right]$
\end_inset
-..
+.
+\end_layout
+
+\end_inset
+
+.
Dolžina sprehoda je število prehojenih povezav.
Sprehod je
\series bold
@@ -7532,11 +7534,7 @@ Naj bo
\end_inset
in
-\begin_inset Formula $\left(a+I\right)\cdot$
-\end_inset
-
-'
-\begin_inset Formula $\left(b+I\right)=a\cdot b+I$
+\begin_inset Formula $\left(a+I\right)\cdot'\left(b+I\right)=a\cdot b+I$
\end_inset
.
diff --git a/šola/p2/dn/DN09b_63230317.c b/šola/p2/dn/DN09b_63230317.c
new file mode 100644
index 0000000..daca2bf
--- /dev/null
+++ b/šola/p2/dn/DN09b_63230317.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+int next (bool * s, int l) {
+ bool hit0 = false;
+ bool hit1after0 = false;
+ int end1count = 0;
+ int end1 = l-1;
+ for (int i = l-1; i >= 0; i--) {
+ if (!s[end1])
+ end1--;
+ if (!hit0 && s[i] == 1)
+ end1count++;
+ if (!s[i])
+ hit0 = true;
+ if (hit0 && s[i])
+ hit1after0 = true;
+ }
+ if (end1 == -1) { // prazen vhod, sedaj 1 bit
+ for (int i = 0; i < l; i++)
+ s[i] = false;
+ s[0] = true;
+ return 1;
+ }
+ if (!hit0)
+ return len+1; // konec
+ if (!hif1after0) { // inc št enic
+ for (int i = 0; i < l; i++) {
+ s[i] = false;
+ if (i < end1count)
+ s[i] = true;
+ }
+ return end1count;
+ }
+}
+int main (void) {
+ int s, g, m;
+ scanf("%d", &s);
+ char * i[s];
+ char * r[s];
+ for (int i = 0; i < s; i++)
+ scanf("%ms %ms", &i[s], &r[s]);
+ scanf("%d", &g);
+ char * gl[g];
+ for (int i = 0; i < s; i++)
+ scanf("%ms", &gl[s]);
+ bool samost[s];
+}