結果

問題 No.1285 ゴミ捨て
ユーザー TomoyarnTomoyarn
提出日時 2022-02-02 16:50:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 79,620 KB
最終ジャッジ日時 2023-09-02 02:51:13
合計ジャッジ時間 5,006 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,476 KB
testcase_01 AC 67 ms
71,332 KB
testcase_02 AC 65 ms
71,336 KB
testcase_03 AC 68 ms
71,552 KB
testcase_04 AC 65 ms
71,448 KB
testcase_05 AC 63 ms
71,144 KB
testcase_06 AC 65 ms
71,152 KB
testcase_07 AC 127 ms
79,328 KB
testcase_08 AC 85 ms
76,932 KB
testcase_09 AC 107 ms
78,328 KB
testcase_10 AC 123 ms
79,184 KB
testcase_11 AC 119 ms
79,224 KB
testcase_12 AC 110 ms
78,632 KB
testcase_13 AC 109 ms
78,456 KB
testcase_14 AC 127 ms
79,476 KB
testcase_15 AC 115 ms
78,524 KB
testcase_16 AC 97 ms
77,364 KB
testcase_17 AC 95 ms
77,636 KB
testcase_18 AC 96 ms
77,688 KB
testcase_19 AC 103 ms
78,024 KB
testcase_20 AC 93 ms
77,508 KB
testcase_21 AC 95 ms
77,520 KB
testcase_22 AC 132 ms
79,620 KB
testcase_23 AC 133 ms
79,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def yukicoder1285(N, A):
    A = sorted(A)
    ans = 1
    for i in range(1, N):
        if A[i] - A[i - 1] == 1:
            ans = 2
            break
    return ans



N = int(input())
A = [int(input()) for _ in range(N)]
print(yukicoder1285(N, A))
0