From f74f3c4ec74d2883f4d428f245931f2fcf97080f Mon Sep 17 00:00:00 2001 From: yenru0 Date: Wed, 5 Aug 2020 21:18:51 +0900 Subject: [PATCH] add 1025 1918 12101 1076 1247 complete 1076 1247 wander 1025 1918 12101 --- zeta_python/1025.py | 2 ++ zeta_python/12101.py | 13 +++++++++++ zeta_python/1918.py | 44 +++++++++++++++++++++++++++++++++++ zeta_python/completed/1076.py | 13 +++++++++++ zeta_python/completed/1247.py | 13 +++++++++++ 5 files changed, 85 insertions(+) create mode 100644 zeta_python/1025.py create mode 100644 zeta_python/12101.py create mode 100644 zeta_python/1918.py create mode 100644 zeta_python/completed/1076.py create mode 100644 zeta_python/completed/1247.py diff --git a/zeta_python/1025.py b/zeta_python/1025.py new file mode 100644 index 0000000..76f005f --- /dev/null +++ b/zeta_python/1025.py @@ -0,0 +1,2 @@ +N, M = map(int, input().split()) +I = [list(map(int, input())) for i in range(N)] diff --git a/zeta_python/12101.py b/zeta_python/12101.py new file mode 100644 index 0000000..ce3c864 --- /dev/null +++ b/zeta_python/12101.py @@ -0,0 +1,13 @@ +n, k = map(int, input().split()) +t = [] + + +# TODO: +# +# +# +# +# +# +# + diff --git a/zeta_python/1918.py b/zeta_python/1918.py new file mode 100644 index 0000000..a702fe6 --- /dev/null +++ b/zeta_python/1918.py @@ -0,0 +1,44 @@ +import re +OUT = [] +def turn_exp(start): + t = start + first = None + second = None + op = None + if tokens[t].isalpha(): + first = tokens[t] + t += 1 + elif tokens[t] == "(": + rr = turn_exp(t+1) + first = rr[1] + t = rr[0] + if tokens[t] == ")": + t += 1 + if isinstance(first, str): + OUT.append(first) + if tokens[t] in "+-*/": + op = tokens[t] + t += 1 + + if tokens[t].isalpha(): + second = tokens[t] + t += 1 + elif tokens[t] == "(": + rr = turn_exp(t+1) + second = rr[1] + t = rr[0] + if tokens[t] == ")": + t += 1 + if isinstance(second, str): + OUT.append(second) + OUT.append(op) + return t, [first, second, op] + +tokens = input() + + + +#_, parsed = turn_exp(0) +#for o in OUT: + #print(o, end = '') +# TODO: 중위 표기식의 연산순서 A+B+C 같은거 \ No newline at end of file diff --git a/zeta_python/completed/1076.py b/zeta_python/completed/1076.py new file mode 100644 index 0000000..45cd7a3 --- /dev/null +++ b/zeta_python/completed/1076.py @@ -0,0 +1,13 @@ +VALUE = { + "black": 0, + "brown": 1, + "red": 2, + "orange":3, + "yellow":4, + "green": 5, + "blue": 6, + "violet": 7, + "grey": 8, + "white": 9} + +print((10*VALUE[input()] + VALUE[input()])*10**VALUE[input()]) \ No newline at end of file diff --git a/zeta_python/completed/1247.py b/zeta_python/completed/1247.py new file mode 100644 index 0000000..442c000 --- /dev/null +++ b/zeta_python/completed/1247.py @@ -0,0 +1,13 @@ +import sys +for _ in range(3): + N = int(sys.stdin.readline()) + t = 0 + for i in range(N): + t += int(sys.stdin.readline()) + + if t > 0: + print("+") + elif t < 0: + print("-") + else: + print("0") \ No newline at end of file