結果

問題 No.1285 ゴミ捨て
ユーザー paruf4paruf4
提出日時 2020-11-13 22:36:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 12,592 KB
最終ジャッジ日時 2023-09-30 03:37:55
合計ジャッジ時間 4,001 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,768 KB
testcase_01 AC 15 ms
7,712 KB
testcase_02 AC 15 ms
7,844 KB
testcase_03 AC 15 ms
7,716 KB
testcase_04 AC 15 ms
7,792 KB
testcase_05 AC 15 ms
7,908 KB
testcase_06 AC 15 ms
7,924 KB
testcase_07 WA -
testcase_08 AC 23 ms
8,312 KB
testcase_09 AC 114 ms
9,964 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 57 ms
8,848 KB
testcase_17 AC 59 ms
8,888 KB
testcase_18 AC 56 ms
8,904 KB
testcase_19 WA -
testcase_20 AC 51 ms
8,704 KB
testcase_21 AC 70 ms
9,088 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = []
for i in range(n):
    aa = int(input())
    a.append(aa)
a.sort()
f = False
res = 0
for i in range(n-1):
    if f:
        if a[i+1]-a[i] > 1:
            pass
        else:
            tmp = 0
            f = False
            res += 1
    else:
        if a[i+1]-a[i] > 1:
            f = True
        else:
            res += 1
res += 1
print(res)
0