Moved kattis from Uni repo

This commit is contained in:
2023-12-01 13:35:13 +01:00
parent 28a6b807a3
commit aaa2c123b8
164 changed files with 3008 additions and 0 deletions

View File

@ -0,0 +1,17 @@
16 16
................
...\O....OAO....
................
...\O..\O...O/..
................
...\O..\O...O/..
................
...\O.......O/..
................
....\O.....O/...
................
.....\O...O/....
................
......\O.O/.....
................
.......\O.......

View File

@ -0,0 +1,4 @@
3 5
.....
.....
.....

View File

@ -0,0 +1,33 @@
#include <stdint.h>
#include <stdio.h>
int main(int argc, char **argv) {
int n, m;
scanf("%d %d", &n, &m);
int ingredients = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
char c;
scanf(" %c", &c);
if (c == '.') {
ingredients += 20;
} else if (c == 'O') {
ingredients += 10;
} else if (c == '\\' || c == '/') {
ingredients += 25;
} else if (c == 'A') {
ingredients += 35;
} else if (c == '^') {
ingredients += 5;
} else if (c == 'v') {
ingredients += 22;
}
}
}
printf("%d\n", ingredients);
return 0;
}

View File

@ -0,0 +1,35 @@
#include <stdint.h>
#include <stdio.h>
int main(int argc, char **argv) {
int n, m;
scanf("%d %d", &n, &m);
int ingredients = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
char c;
scanf(" %c", &c);
printf("%c", c);
if (c == '.') {
ingredients += 20;
} else if (c == '0') {
ingredients += 10;
} else if (c == '\\' || c == '/') {
ingredients += 25;
} else if (c == 'A') {
ingredients += 35;
} else if (c == '^') {
ingredients += 5;
} else if (c == 'v') {
ingredients += 22;
}
}
printf("\n");
}
printf("%d\n\a", ingredients);
return 0;
}

View File

@ -0,0 +1,19 @@
n,m = [int(x) for x in input().split(" ")]
ingredients = {
'.': [20, 0],
'O': [10, 0],
'\\': [25, 0],
'/': [25, 0],
'A': [35, 0],
'^': [5, 0],
'v': [22, 0]
}
for i in range(n):
string = input()
for token in string:
ingredients[token][1] += 1
real_values = [x[0] * x[1] for x in ingredients.values()]
print(sum(real_values))

Binary file not shown.