We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
n, m = map(int, input().split()) k = list(map(int, input().split())) result = 0 for i in range(n): for j in range(i, n): if k[i] != k[j]: result += 1 print(result)
저는 이런 식으로 풀었는데 이렇게 풀어도 괜찮을까요?
책에 나와있는 답안과 많이 다르게 푼 것 같아서 질문 드립니다!
The text was updated successfully, but these errors were encountered:
출력에는 문제가 없으나 시간복잡도 O(n^2)을 가져서 책에 나온 풀이보단 효율이 떨어집니다.
Sorry, something went wrong.
No branches or pull requests
저는 이런 식으로 풀었는데 이렇게 풀어도 괜찮을까요?
책에 나와있는 답안과 많이 다르게 푼 것 같아서 질문 드립니다!
The text was updated successfully, but these errors were encountered: