結果

問題 No.1268 Fruit Rush 2
ユーザー trineutrontrineutron
提出日時 2020-10-23 22:47:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 195 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 35,528 KB
最終ジャッジ日時 2023-09-28 17:07:42
合計ジャッジ時間 6,486 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,784 KB
testcase_01 AC 16 ms
7,824 KB
testcase_02 AC 15 ms
7,808 KB
testcase_03 AC 15 ms
7,860 KB
testcase_04 AC 15 ms
7,864 KB
testcase_05 AC 16 ms
7,924 KB
testcase_06 AC 16 ms
7,812 KB
testcase_07 AC 16 ms
7,840 KB
testcase_08 AC 16 ms
7,868 KB
testcase_09 AC 16 ms
7,884 KB
testcase_10 AC 16 ms
7,864 KB
testcase_11 AC 16 ms
7,840 KB
testcase_12 AC 16 ms
7,920 KB
testcase_13 AC 16 ms
7,912 KB
testcase_14 AC 16 ms
7,832 KB
testcase_15 AC 15 ms
7,764 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 295 ms
29,864 KB
testcase_27 AC 297 ms
29,944 KB
testcase_28 AC 304 ms
30,000 KB
testcase_29 AC 303 ms
29,996 KB
testcase_30 AC 307 ms
29,876 KB
testcase_31 AC 267 ms
29,960 KB
testcase_32 AC 260 ms
29,888 KB
testcase_33 AC 193 ms
35,380 KB
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
l = 0
for i in range(n):
    l += 1
    ans += l // 2 + 1
    if i < n - 1 and a[i + 1] != a[i] + 1:
        l = 0
print(ans)
0