How To Deal With Cheaters

Revision en2, by 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.

Tags easy, no, more, cheaters

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English doraimota 2025-01-10 10:39:31 23
en1 English doraimota 2025-01-10 09:13:36 819 Initial revision (published)