summaryrefslogtreecommitdiffstats
path: root/inf/lige/3
diff options
context:
space:
mode:
Diffstat (limited to 'inf/lige/3')
-rw-r--r--inf/lige/3/1.c30
-rw-r--r--inf/lige/3/1.cpp46
-rw-r--r--inf/lige/3/3.c47
-rw-r--r--inf/lige/3/3.txt7
-rw-r--r--inf/lige/3/4.c67
5 files changed, 197 insertions, 0 deletions
diff --git a/inf/lige/3/1.c b/inf/lige/3/1.c
new file mode 100644
index 0000000..56e5191
--- /dev/null
+++ b/inf/lige/3/1.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <stdlib.h>
+struct range {
+ int z;
+ int k;
+};
+struct range gen_range () {
+
+}
+int main (void) {
+ char * buf = malloc(300000);
+ fgets(buf, 255, stdin);
+ fgets(buf, 300000, stdin);
+ char * c = buf;
+ int len = 0;
+ int * a = malloc(10000*sizeof *a);
+ while (c) {
+ a[len++] = strtol(c, &c, 10);
+ c++;
+ }
+ unsigned long long int sum;
+ int z = 0;
+ int k = 0;
+ int sqrt
+ work
+ if (z == lkl) {
+
+ }
+ printf("%llu\n", sum);
+}
diff --git a/inf/lige/3/1.cpp b/inf/lige/3/1.cpp
new file mode 100644
index 0000000..d8eb85f
--- /dev/null
+++ b/inf/lige/3/1.cpp
@@ -0,0 +1,46 @@
+#include <iostream>
+#include <set>
+#include <algorithm>
+using namespace std;
+class Obmo {
+ public:
+ int z, k, nsd;
+ set<int> obm;
+ Obmo () {
+ z = 0;
+ k = 0;
+ obm.clear();
+ }
+ void dodaj (int val) {
+ if (!obm.count()) {
+ nsd = val;
+ obm.insert(val);
+ return;
+ }
+ if (obm.count() == 1) {
+ nsd = gcd(val, nsd);
+ obm.insert(val);
+ return;
+ }
+ if (val % nsd == 0) {
+ obm.insert(val);
+ return;
+ }
+ for (auto itr = obm.begin(); itr != obm.end(); itr++) {
+ if *itr:q
+
+ }
+ }
+ void odvzemi (int val) {
+ if (obm.count() == 2) {
+ obm.erase(val);
+ nsd = gcd(*obm.begin())
+ }
+ }
+ int get (void) {
+ return nsd;
+ }
+};
+int main (void) {
+ cout << "hw" << endl;
+}
diff --git a/inf/lige/3/3.c b/inf/lige/3/3.c
new file mode 100644
index 0000000..a0fcecc
--- /dev/null
+++ b/inf/lige/3/3.c
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <stdlib.h>
+#define I unsigned long long int
+// ajde 10 točk?
+int x (int n, int idx, int vrs) {
+ if (vrs <= n)
+ return idx;
+ else
+ return idx + vrs - n;
+}
+I y (int n, int idx, int vrs) {
+ if (vrs <= n)
+ return vrs - idx;
+ else
+ return idx;
+}
+I grdo (int x, int y, int n, char * sat) {
+ if (sat[y*1024+x])
+ return 0;
+ I sum = 0;
+ if (x == n-1 && y == n-1)
+ return 1;
+ if (x < n-1 && y)
+ sum += grdo(x+1, y+1, n, sat);
+ if (x < n-1)
+ sum += grdo(x+1, y, n, sat);
+ if (y < n-1)
+ sum += grdo(x, y+1, n, sat);
+ return sum;
+}
+int main (void) {
+ char * sat = malloc(1024*1024);
+ char buf[255];
+ fgets(buf, 255, stdin);
+ int n = atoi(buf);
+ fgets(buf, 255, stdin);
+ int k = atoi(buf);
+ while (k--) {
+ fgets(buf, 255, stdin);
+ char * c = buf;
+ int vrs = strtol(c, &c, 10);
+ c++;
+ int idx = strtol(c, &c, 10);
+ sat[y(n, idx, vrs)*1024+x(n, idx, vrs)]++;
+ }
+ printf("%llu\n", grdo(0, 0, n, sat) % 1000000007);
+}
diff --git a/inf/lige/3/3.txt b/inf/lige/3/3.txt
new file mode 100644
index 0000000..ad96f81
--- /dev/null
+++ b/inf/lige/3/3.txt
@@ -0,0 +1,7 @@
+4
+5
+2 1
+3 0
+3 3
+4 2
+5 0
diff --git a/inf/lige/3/4.c b/inf/lige/3/4.c
new file mode 100644
index 0000000..d92ebd3
--- /dev/null
+++ b/inf/lige/3/4.c
@@ -0,0 +1,67 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#define I unsigned long long int
+/*
+I nasl (I cur) {
+ char buf[255];
+ int len = sprintf(buf, cur);
+ I tmp = cur;
+ I cnt = 0;
+ while (tmp % 10 == 9) {
+ cnt++;
+ if (tmp == 9)
+ return pow(10, cnt)+1;
+ tmp /= 10;
+ }
+ for (int i = 0; i < len/2; i++)
+ buf[len-i-1] = buf[i];
+ if (atoll(buf) <= cur) {
+ int i = len/2-1;
+ int j = len/2;
+ int carry = 0;
+ while (i >= 0) {
+ if (buf[i] == '9') {
+ buf[i] = '0';
+ carry++;
+ }
+ buf[j++] = buf[i--];
+ }
+ if (buf[len/2] == '9') {
+ if len
+ buf[len/2] = '0';
+ buf[len/2] = '0';
+ }
+ }
+}
+*/
+int main (void) {
+ char buf[255];
+ fgets(buf, 255, stdin);
+ char * c = buf;
+ I z = strtoull(c, &c, 10);
+ c++;
+ I k = strtoull(c, &c, 10);
+ // I palind = nasl(z-1);
+ for (I i = z; i <= k; i++) {
+ /* if (i == palind) {
+ puts("Palindrom!\n");
+ palind = nasl(i);
+ continue;
+ } */
+ char s[512];
+ int l = sprintf(s, "%llu", i);
+ if (l < 1) {
+ puts("Palindrom!");
+ continue;
+ }
+ for (int j = 0; j < l/2; j++)
+ if (s[j] != s[l-j-1]) {
+ puts(s);
+ goto c;
+ }
+ puts("Palindrom!");
+ c:
+ ;
+ }
+}