結果

問題 No.1285 ゴミ捨て
ユーザー hiragnhiragn
提出日時 2022-11-23 10:51:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 661 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 11,772 KB
実行使用メモリ 45,652 KB
最終ジャッジ日時 2023-10-24 21:18:33
合計ジャッジ時間 16,551 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 482 ms
42,284 KB
testcase_01 AC 448 ms
42,364 KB
testcase_02 AC 439 ms
42,364 KB
testcase_03 AC 441 ms
42,364 KB
testcase_04 AC 442 ms
42,364 KB
testcase_05 AC 443 ms
42,364 KB
testcase_06 AC 442 ms
42,364 KB
testcase_07 AC 650 ms
45,652 KB
testcase_08 AC 452 ms
42,364 KB
testcase_09 AC 532 ms
42,956 KB
testcase_10 AC 622 ms
45,124 KB
testcase_11 AC 607 ms
44,276 KB
testcase_12 AC 561 ms
43,484 KB
testcase_13 AC 561 ms
43,484 KB
testcase_14 AC 637 ms
45,388 KB
testcase_15 AC 583 ms
43,748 KB
testcase_16 AC 483 ms
42,364 KB
testcase_17 AC 487 ms
42,364 KB
testcase_18 AC 479 ms
42,364 KB
testcase_19 AC 524 ms
42,956 KB
testcase_20 AC 473 ms
42,364 KB
testcase_21 AC 493 ms
42,364 KB
testcase_22 AC 655 ms
45,652 KB
testcase_23 AC 661 ms
45,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np


def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]

    if len(a) == 1:
        exit(print(1))

    ans = 1 if min(np.diff(sorted(a))) > 1 else 2
    print(ans)


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