Most efficient solution for USACO: Cow Gymnastics - Python
Suggestions:

Use the variable names from the problem specification instead of inventing your own (just make them lower-case since that's preferred in Python code). Makes it easier to see the connections. Unless yours are much better.
I guess nums is plural so num is a single number, but you can iterate it? Bad name. And wth does asdf mean?
Python prefers snake_case for function names.
To be honest, the lack of any explanation of your method, the name asdf and the highly convoluted code made me give up reading it. But here's my solution, simply counting occurring pairs and then the result is the number of pairs that appeared K times:

from itertools import combinations
from collections import Counter

ctr = Counter()
with open('gymnastics.in') as f:
    k, _ = map(int, next(f).split())
    for session in f:
        cows = session.split()
        ctr.update(combinations(cows, 2))

with open('gymnastics.out', 'w') as f:
    print(list(ctr.values()).count(k), file=f)