Moved kattis from Uni repo
This commit is contained in:
5
kattis/problems/old/aliennumbers/1.in
Normal file
5
kattis/problems/old/aliennumbers/1.in
Normal file
@ -0,0 +1,5 @@
|
||||
4
|
||||
9 0123456789 oF8
|
||||
Foo oF8 0123456789
|
||||
13 0123456789abcdef 01
|
||||
CODE O!CDE? A?JM!.
|
37
kattis/problems/old/aliennumbers/main.c
Normal file
37
kattis/problems/old/aliennumbers/main.c
Normal file
@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int t;
|
||||
scanf("%d", &t);
|
||||
|
||||
int printed = 0;
|
||||
for (int i=0; i<t; i++) {
|
||||
// Newlines
|
||||
if(printed) printf("\n");
|
||||
else printed = 1;
|
||||
|
||||
char word[100];
|
||||
char src[95];
|
||||
char dst[95];
|
||||
|
||||
scanf("%s %s %s", word, src, dst);
|
||||
int idx = 0;
|
||||
for (int i=0; i<strlen(src); i++) {
|
||||
for(int j=0; j<strlen(word); j++) {
|
||||
if (src[i] == word[j]) {
|
||||
for (int k=0; k<i; k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Print case number
|
||||
printf("Case #%d: ", i);
|
||||
// TODO: Print the translation
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
27
kattis/problems/old/aliennumbers/main.py
Normal file
27
kattis/problems/old/aliennumbers/main.py
Normal file
@ -0,0 +1,27 @@
|
||||
def src_to_int(code, language):
|
||||
length = len(language)
|
||||
result = 0
|
||||
n = 0
|
||||
m = {language[x]:x for x in range(length)}
|
||||
for i in reversed(code):
|
||||
s += m[i] * length ** n
|
||||
n += 1
|
||||
return s
|
||||
|
||||
def int_to_src(number, language):
|
||||
length = len(language)
|
||||
result = ""
|
||||
n = 0
|
||||
m = {x:language[x] for x in range(length)}
|
||||
while num > 0:
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
cases:int = int(input())
|
||||
|
||||
for i in range(cases):
|
||||
word, src, dst = input().split(" ")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Reference in New Issue
Block a user