結果

問題 No.1268 Fruit Rush 2
ユーザー hanyuhanyu
提出日時 2020-05-31 15:32:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 327 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 10,520 KB
実行使用メモリ 35,424 KB
最終ジャッジ日時 2023-09-04 08:32:51
合計ジャッジ時間 6,705 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
9,508 KB
testcase_01 AC 84 ms
9,640 KB
testcase_02 AC 84 ms
9,460 KB
testcase_03 AC 79 ms
9,628 KB
testcase_04 AC 83 ms
9,628 KB
testcase_05 AC 80 ms
9,544 KB
testcase_06 AC 84 ms
9,628 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 84 ms
9,632 KB
testcase_10 AC 80 ms
9,592 KB
testcase_11 AC 80 ms
9,600 KB
testcase_12 RE -
testcase_13 AC 81 ms
9,508 KB
testcase_14 AC 80 ms
9,460 KB
testcase_15 RE -
testcase_16 AC 226 ms
25,612 KB
testcase_17 AC 207 ms
23,044 KB
testcase_18 AC 213 ms
23,992 KB
testcase_19 AC 215 ms
23,724 KB
testcase_20 AC 220 ms
23,744 KB
testcase_21 AC 213 ms
23,156 KB
testcase_22 AC 229 ms
25,832 KB
testcase_23 AC 240 ms
25,832 KB
testcase_24 AC 225 ms
23,700 KB
testcase_25 AC 213 ms
23,520 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 284 ms
29,948 KB
testcase_32 AC 291 ms
29,936 KB
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

x = [0] * 200000

for i in range(n):
    x[a[i] - 1] = x[a[i] - 1] + 1

for i in range(199998):
    j = 199997 - i
    if x[j] > 0:
        x[j] += x[j + 2]
    
ans = n
for i in range(200000):
    if i > 0 and x[i - 1] > 0 and x[i] > 0:
        ans += x[i]
    
print(ans)
0