# -*- coding:utf-8 -*-
class Solution:
# array 二维列表
def Find(self, target, array):
# write code here
n = len(array)
flag = 'false'
if array == [[]]:
return flag
i = n-1
j = 0
while i >= 0 and j <= n-1:
if target < array[i][j]:
i = i - 1
elif target > array[i][j]:
j = j + 1
else:
flag = 'true'
break
return flag
while True:
try:
S = Solution()
L = list(eval(raw_input()))
array = L[1]
target = L[0]
print(S.find(target,array))
except:
break;
调用的时候写成了小写的f,您的代码已保存
答案错误:您提交的程序没有通过所有的测试用例
case通过率为11.76%
用例:
5,[[1,2,8,9],[2,4,9,12],[4,7,10,13],[6,8,11,15]]
对应输出应该为:
false
你的输出为:
true