laxmi_kanth's blog

By laxmi_kanth, history, 23 months ago, In English

My solution of code forces round div 3 for C (train queries) was hacked and I didn't find the case where I would fail.Please help me find that case. I really appreciate any help you can provide.

Here is my code ```

def solve(): d = defaultdict(list)

# n = int(input())
# s=input()
e=input()
n,m=list(map(int,input().split()))
#
lis = list(map(int, input().split()))
# lis1=input().split()
# lis2 = list(map(int, input().split()))
# lis3 = list(map(int, input().split()))
# n,r,b=list(map(int,input().split()))
# order=list(map(int,input().split()))
# r2,c2=list(map(int,input().split()))
# ans=[[-1 for _ in range(m)] for _ in rnage(n)]
for i,ele in enumerate(lis):
    d[ele].append(i)
for _ in range(m):
    u,v=list(map(int,input().split()))
    if(u not in d or v not in d):
        print("NO")
        continue
    if(d[u][0]<d[v][-1]):
        print("YES")
    else:
        print("NO")

```

Full text and comments »

  • Vote: I like it
  • -4
  • Vote: I do not like it