結果

問題 No.1285 ゴミ捨て
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2022-07-05 07:48:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 78,876 KB
最終ジャッジ日時 2023-08-21 18:47:59
合計ジャッジ時間 5,308 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,220 KB
testcase_01 AC 71 ms
71,188 KB
testcase_02 AC 71 ms
71,504 KB
testcase_03 AC 73 ms
71,292 KB
testcase_04 AC 74 ms
71,156 KB
testcase_05 AC 74 ms
71,296 KB
testcase_06 AC 74 ms
71,436 KB
testcase_07 AC 160 ms
78,756 KB
testcase_08 AC 101 ms
76,812 KB
testcase_09 AC 129 ms
77,796 KB
testcase_10 AC 153 ms
78,336 KB
testcase_11 AC 150 ms
78,508 KB
testcase_12 AC 138 ms
78,116 KB
testcase_13 AC 138 ms
78,236 KB
testcase_14 AC 160 ms
78,564 KB
testcase_15 AC 144 ms
78,040 KB
testcase_16 AC 112 ms
77,392 KB
testcase_17 AC 110 ms
77,424 KB
testcase_18 AC 111 ms
77,316 KB
testcase_19 AC 125 ms
77,688 KB
testcase_20 AC 109 ms
77,436 KB
testcase_21 AC 114 ms
77,340 KB
testcase_22 AC 166 ms
78,652 KB
testcase_23 AC 165 ms
78,876 KB
権限があれば一括ダウンロードができます

ソースコード

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