結果

問題 No.1285 ゴミ捨て
ユーザー toshiro_yanagi
提出日時 2022-07-05 07:48:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 462 ms
コンパイル使用メモリ 82,232 KB
実行使用メモリ 77,428 KB
最終ジャッジ日時 2024-12-15 08:39:55
合計ジャッジ時間 5,650 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

bufio_scanner = []


def main():
    n = int(fmt_scan())
    a = [int(fmt_scan()) for _ in range(n)]
    a.sort()

    ans = 1
    for i, _ in enumerate(a):
        if i == 0:
            continue
        if a[i] == a[i - 1] + 1:
            ans = 2
    print(ans)


def fmt_scan() -> str:
    sc = bufio_scanner
    if len(sc) == 0:
        for v in reversed(input().split()):
            sc.append(v)
    res = sc[-1]
    sc.pop()
    return res


main()
0