8

Hacking on Codeforces Round 805 div 3

 1 year ago
source link: http://codeforces.com/blog/entry/104722
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Hacking on Codeforces Round 805 div 3

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")

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK