結果
| 問題 | No.1470 Mex Sum |
| コンテスト | |
| ユーザー |
wolgnik
|
| 提出日時 | 2021-04-09 21:29:20 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 2,000 ms |
| コード長 | 268 bytes |
| 記録 | |
| コンパイル時間 | 177 ms |
| コンパイル使用メモリ | 85,696 KB |
| 実行使用メモリ | 99,224 KB |
| 最終ジャッジ日時 | 2026-03-11 09:04:24 |
| 合計ジャッジ時間 | 3,602 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 49 |
ソースコード
import sys input = sys.stdin.readline N = int(input()) a = list(map(int, input().split())) one = a.count(1) two = a.count(2) other = N - one - two print(two * (two - 1) // 2 + other * (other - 1) // 2 + two * other + one * (one - 1) + one * other * 2 + one * two * 3)
wolgnik