結果
| 問題 | No.1470 Mex Sum |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2021-04-10 00:14:39 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 122 ms / 2,000 ms |
| + 553µs | |
| コード長 | 223 bytes |
| 記録 | |
| コンパイル時間 | 304 ms |
| コンパイル使用メモリ | 21,536 KB |
| 実行使用メモリ | 22,424 KB |
| 最終ジャッジ日時 | 2026-07-29 20:45:03 |
| 合計ジャッジ時間 | 8,682 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 49 |
ソースコード
import sys input = sys.stdin.readline from collections import Counter N=int(input()) A=list(map(int,input().split())) C=Counter(A) ONE=C[1] TWO=C[2] ANS=N*(N-1)//2 ANS+=ONE*(N-1)-ONE*(ONE-1)//2 ANS+=ONE*TWO print(ANS)
titia