結果

問題 No.1285 ゴミ捨て
ユーザー kept1994kept1994
提出日時 2021-09-29 17:05:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 78,624 KB
最終ジャッジ日時 2023-09-23 13:05:25
合計ジャッジ時間 5,129 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,392 KB
testcase_01 AC 68 ms
71,240 KB
testcase_02 AC 71 ms
71,236 KB
testcase_03 AC 68 ms
71,436 KB
testcase_04 AC 69 ms
71,204 KB
testcase_05 AC 68 ms
71,104 KB
testcase_06 AC 69 ms
71,220 KB
testcase_07 AC 138 ms
78,464 KB
testcase_08 AC 88 ms
76,864 KB
testcase_09 AC 108 ms
77,684 KB
testcase_10 AC 129 ms
78,344 KB
testcase_11 AC 126 ms
78,452 KB
testcase_12 AC 117 ms
77,720 KB
testcase_13 AC 113 ms
77,912 KB
testcase_14 AC 131 ms
78,340 KB
testcase_15 AC 118 ms
78,276 KB
testcase_16 AC 97 ms
77,048 KB
testcase_17 AC 96 ms
77,512 KB
testcase_18 AC 95 ms
77,184 KB
testcase_19 AC 110 ms
77,640 KB
testcase_20 AC 98 ms
77,328 KB
testcase_21 AC 100 ms
77,328 KB
testcase_22 AC 140 ms
78,456 KB
testcase_23 AC 139 ms
78,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys

def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    
    for i in range(N - 1):
        if A[i + 1] - A[i] == 1:
            print(2)
            return
    print(1)
    return


if __name__ == '__main__':
    main()
0