-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
LIOJ #1047 搜尋數字 PY3 TLE #432
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
def search(arr , t):
for i in range(len(arr)):
if arr[i] == t:
return i
return "-1"
n, m = map(int, input().split())
nums = [int(input()) for _ in range(n)]
for _ in range(m):
t = int(input())
print(search(nums,t))
按照老師的作法,沒有辦法在同樣的時間複雜度下通過測試,希望放開一些標準,
The text was updated successfully, but these errors were encountered: