Does Codeforces Detect AI Code?

What the official Codeforces rule on AI says, which uses are allowed and banned in rated rounds, how Codeforces says it identifies cheating, and what that means for students who compete.

0 / 8,000 characters

Codeforces is one of the largest competitive programming sites, and many CS students use its rated rounds to build problem-solving skill. Since AI models started solving contest problems, Codeforces has had an explicit rule about them. That rule draws a clear line between allowed and banned uses during rounds. On detection, it describes matching code between contestants, not a tool that recognizes AI-written code on its own. The description below comes from the official rule posted on codeforces.com, which we read in October 2026.

The official rule

The rule is a blog post titled "Rule Restricting the Use of AI", revision dated September 14, 2024, posted by MikeMirzayanov, whose profile is marked as Codeforces Headquarters. It explains that neural networks have improved quickly at contest problems, and that Codeforces is therefore explicitly limiting the use of AI-based systems, naming models such as GPT, Gemini, Gemma, Llama and Claude, for solving programming problems. It also says AI can be a valuable tool for learning and coding help, and the goal is to set clear boundaries.

When the rule applies

According to the post, the rule applies strictly to in-contest participation. That covers registered contestants and out-of-competition participants in any rated Codeforces round. It also covers an unrated round if the round's announcement or rules say so. Outside such contests, the post says AI tools may be used freely for practice, learning or non-competitive problem-solving.

What is allowed during a round

  • Translating the problem statement with an AI system, as long as it is a direct translation. The tool must not interpret or summarize the statement.
  • Code completion tools such as Copilot, but only for syntax and minor coding suggestions.
  • Simple boilerplate, such as input/output functions, generated by AI.

What is banned during a round

  • Putting the problem statement, its summary, any excerpt, or a sub-problem into an AI system to get ready-made code or a description of the solution in words.
  • Using AI to diagnose or fix errors based on system feedback, for example asking a chatbot for help after a verdict like "Runtime error on test 1".
  • Using AI tools for problem understanding, logic creation or decision-making in a way that substitutes for your own reasoning.
  • Relying on AI to generate the algorithmic logic or the key solution.

If you are unsure whether a particular use crosses the line, the rule says to consult the competition organizers. That is the right move, rather than deciding for yourself during the round.

How Codeforces says it identifies cheating

The rule has a short section on cheating detection. It says the rule lets Codeforces keep identifying cheating as it did before the AI era: if two contestants' code matches, and the matched code did not exist publicly on the internet before the round, that is considered evidence of cheating.

A few things follow from that, and a few things are simply not stated:

  • The official rule describes matching between submissions, not an AI-code classifier.
  • It does not describe any other detection method, any thresholds, or any accuracy figures.
  • The post says Codeforces will monitor AI development and adapt the rules as needed, so the details can change.

Matching is relevant to AI because many people giving the same problem to the same kind of model can end up with closely matching code. A match still does not say where the code came from, which is the same limit classroom similarity tools have. See does MOSS detect AI-generated code for a fuller explanation.

Why the line is drawn where it is

The rule's logic is easy to follow: a contest rating is supposed to measure your own reasoning. Help with typing, syntax or reading a statement in your language does not replace that reasoning. Help with deciding what the algorithm is, or with fixing the bug the judge just found, does. Keeping that purpose in mind answers most edge cases better than memorizing the list.

What this means for students

  • During a rated round, solve the problems yourself. Use AI only in the narrow ways the rule allows.
  • Outside contests, AI is allowed for practice. It works best for learning when you attempt the problem first and then ask for an explanation, rather than asking for the answer.
  • Your rating is only useful if it is yours. Interviewers and teammates will see how you actually solve problems, and a rating you did not earn will not help there.
  • If you are accused of matching code, explain your process. Describe how you reached the idea and why the code looks the way it does. Our guide my code was flagged as AI but I wrote it has more on that.

Checking how your code reads

The detector at the top of this page is not part of Codeforces and does not reflect how Codeforces judges anything. It looks at the code you paste and lists style patterns people often associate with AI output. Contest code usually has its own style, with short names and templates, so treat the result as a reading aid for your practice solutions, not a ruling. For the broader set of signs reviewers look for, see how to tell if code was written by ChatGPT.

Read more

Frequently asked questions

Is ChatGPT allowed on Codeforces?

Not for solving problems in rated rounds. The official rule, posted by MikeMirzayanov of Codeforces Headquarters, forbids putting the problem statement, a summary, an excerpt or a sub-problem into an AI system to get code or a solution description. Outside contests, the rule says AI tools may be used freely for practice and learning.

Can I use Copilot during a Codeforces round?

Only in a limited way. The rule allows AI code completion for syntax and minor coding suggestions, and AI-generated simple boilerplate such as input/output functions. Using it to generate the core logic or algorithm is not permitted.

Does Codeforces have an AI detector?

The official rule does not describe one. It says Codeforces will keep identifying cheating as it did before AI: if two contestants' code matches and the matched code did not exist publicly on the internet before the round, that is considered evidence of cheating.

Can I ask AI why my submission got a wrong answer during a round?

No. The rule specifically forbids using AI to diagnose or fix errors based on system feedback, such as after a verdict like Runtime error on test 1.

Does the rule apply to unrated rounds?

The rule applies to rated rounds, for both registered contestants and out-of-competition participants. For an unrated round, it applies if the round announcement or rules say so. If you are unsure, the rule says to ask the competition organizers.

Try the detector

Have a snippet you are unsure about? Paste it into the free AI Code Detector to get a verdict, an AI probability and the reasons behind it. No sign-up, and your code is not stored.