Submission #23734

#TimeUsernameProblemLanguageResultExecution timeMemory
23734leejseo사냥꾼 (KOI13_hunter)Cpython 2
70 / 100
173 ms13 KiB
def main(): m, n, l = map(int, raw_input().split()) s = map(int, raw_input().split()) a = [] for i in range (n) : h = map(int, raw_input().split()) a.append(h[::]) a.sort() s.sort() answer = 0 j = 0 for i in range (n) : while (j<m) and s[j] < a[i][0] : j+=1 flag = False if (j > 0) and (a[i][0] - s[j-1] + a[i][1] <= l) : flag = True if (j < m) and (s[j] - a[i][0] + a[i][1] <= l) : flag = True if flag : answer += 1 print answer return main()
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...