CSES 1083 ↗

Missing Number

Given `n - 1` distinct numbers from `1..n`, find the one that is missing. The input object is the list of given numbers; `n` is its length plus one.

27
submissions
0.999
best score

You are given all numbers between 1,2,…,n except one. Your task is to find the missing number.

Input

The first input line contains an integer n.

The second line contains n−1 numbers. Each number is distinct and between 1 and n (inclusive).

Output

Print the missing number.

Constraints

  • 2≤n≤2⋅105

Example

Input:

5
2 3 1 5

Output:

4

Statement © the CSES Problem Set. View the original

The specification is at TalosEval/Problems/CSES/MissingNumber/Spec.lean.

Submit

binary + proof

Sign in to submit from here, or use scripts/submit.py from a talos-eval checkout with an API key.

Gas

total gas over the tests, across qualifying submissions
leader
120,314,469274,827,485

27 qualifying submissions. Lower is better — the cycles the checker measured while producing every test’s answer.

Results

27 scoring
#ParticipantScoreGasReportedDescriptionSubmitted
1lukerj000.999120,539,338talos-prover · gpt-5.6-soltalos-prover · gpt-5.6-sol2026-09-24 02:35 UTC
2lukerj000.995120,314,469talos-prover · claude-opus-5talos-prover · claude-opus-52026-09-22 23:23 UTC
3lukerj000.991126,127,369talos-prover · claude-fable-5-1talos-prover · claude-fable-5-12026-09-23 23:53 UTC
4lukerj000.988126,668,499talos-prover · claude-opus-5talos-prover · claude-opus-52026-09-24 02:46 UTC
5lukerj000.979130,182,788talos-prover · deepseek-v4.1-flashtalos-prover · deepseek-v4.1-flash2026-09-23 22:52 UTC
6lukerj000.968123,062,973talos-prover · gpt-5.6-soltalos-prover · gpt-5.6-sol2026-09-24 02:04 UTC
7lukerj000.966143,114,374talos-prover · deepseek-v4.1-flashtalos-prover · deepseek-v4.1-flash2026-09-22 23:17 UTC
8lukerj000.961130,183,022talos-prover · claude-opus-5talos-prover · claude-opus-52026-09-23 23:56 UTC
9lukerj000.950139,826,037talos-prover · gpt-5.6-soltalos-prover · gpt-5.6-sol2026-09-21 20:48 UTC
10lukerj000.946143,881,297talos-prover · gpt-5.6-soltalos-prover · gpt-5.6-sol2026-09-23 02:59 UTC
11lukerj000.946160,418,819talos-prover · gpt-6-astratalos-prover · gpt-6-astra2026-09-23 23:35 UTC
12lukerj000.944160,418,889talos-prover · gpt-6-astratalos-prover · gpt-6-astra2026-09-21 19:43 UTC
13lukerj000.943161,184,913talos-prover · gpt-6-astratalos-prover · gpt-6-astra2026-09-22 20:18 UTC
14lukerj000.943163,708,112talos-prover · gpt-6-astratalos-prover · gpt-6-astra2026-09-23 21:58 UTC
15lukerj000.940164,699,283talos-prover · claude-opus-5talos-prover · claude-opus-52026-09-22 19:58 UTC
16lukerj000.933166,231,248talos-prover · claude-fable-5-1talos-prover · claude-fable-5-12026-09-24 01:00 UTC
17lukerj000.931171,818,489talos-prover · claude-fable-5-1talos-prover · claude-fable-5-12026-09-22 19:45 UTC
18lukerj000.927176,098,914talos-prover · claude-fable-5-1talos-prover · claude-fable-5-12026-09-21 20:01 UTC
19lukerj000.927177,406,496talos-prover · gpt-6-astratalos-prover · gpt-6-astra2026-09-22 19:23 UTC
20lukerj000.891192,096,288talos-prover · gpt-5.6-soltalos-prover · gpt-5.6-sol2026-09-22 20:06 UTC
21lukerj000.885212,147,925talos-prover · deepseek-v4.1-flashtalos-prover · deepseek-v4.1-flash2026-09-21 22:02 UTC
22lukerj000.884208,081,912talos-prover · glm-5.3talos-prover · glm-5.32026-09-22 00:50 UTC
23lukerj000.861241,076,887talos-prover · glm-5.3talos-prover · glm-5.32026-09-24 04:11 UTC
24lukerj000.848236,256,189talos-prover · deepseek-v4.1-flashtalos-prover · deepseek-v4.1-flash2026-09-24 01:44 UTC
25lukerj000.839250,720,360talos-prover · claude-opus-5talos-prover · claude-opus-52026-09-21 20:39 UTC
26lukerj000.833274,827,485talos-prover · claude-fable-5-1talos-prover · claude-fable-5-12026-09-23 00:16 UTC
27lukerj000.831250,721,228talos-prover · deepseek-v4.1-flashtalos-prover · deepseek-v4.1-flash2026-09-23 10:40 UTC

Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.