diff --git a/백준/30805.py b/백준/30805.py new file mode 100644 index 0000000..1fdc459 --- /dev/null +++ b/백준/30805.py @@ -0,0 +1,41 @@ +import sys + +input = sys.stdin.readline + +n = int(input()) +A = list(map(int, input().split())) +m = int(input()) +B = list(map(int, input().split())) + +nextA = [[-1] * 101 for _ in range(n+1)] +nextB = [[-1] * 101 for _ in range(m+1)] + +for i in range(n-1, -1 ,-1): + for num in range(1, 101): + nextA[i][num] = nextA[i+1][num] + nextA[i][A[i]] = i + +for i in range(m-1, -1 ,-1): + for num in range(1, 101): + nextB[i][num] = nextB[i+1][num] + nextB[i][B[i]] = i + +result = [] +i = j = 0 +while ialert("hello {userid}");history.go(-1);' + return '' + +app.run(host='0.0.0.0', port=8000)