How To Deal With Cheaters

Правка en2, от doraimota, 2025-01-10 10:39:31

Given amount of Users and their Codes. Determine which Users are Cheaters while Which are Not Cheaters.

User amount <= 10^5, Code Per User <= 10^3.

First, if Two Code from Two Different Users is same, Two Users Both are Cheaters.

Then, we Iterate All pairs of Users and Iterate All pairs of Codes. If code pair is Same, User Pair are Cheaters.

Finally, we Output Those Users who Are Cheaters.

Code is below:

codes = input ("codes")
users = input ("users")

cheaters = []
for u1 in users:
    for u2 in users:
        for c1 in codes:
            for c2 in codes:
                if c1 == c2 and u1 != u2:
                    cheaters.append(u1)
                    cheaters.append(u2)
print (cheaters)

In real Codeforces Might need to get Users and Codes from DataBase.

Теги easy, no, more, cheaters

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский doraimota 2025-01-10 10:39:31 23
en1 Английский doraimota 2025-01-10 09:13:36 819 Initial revision (published)