結果

問題 No.1285 ゴミ捨て
ユーザー chineristACchineristAC
提出日時 2020-11-13 23:01:01
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 87,320 KB
実行使用メモリ 78,812 KB
最終ジャッジ日時 2023-08-19 07:18:56
合計ジャッジ時間 3,681 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,516 KB
testcase_01 AC 64 ms
71,500 KB
testcase_02 AC 65 ms
71,292 KB
testcase_03 AC 66 ms
71,376 KB
testcase_04 AC 62 ms
71,320 KB
testcase_05 AC 61 ms
71,412 KB
testcase_06 AC 65 ms
71,316 KB
testcase_07 AC 126 ms
78,812 KB
testcase_08 AC 83 ms
76,852 KB
testcase_09 AC 102 ms
77,868 KB
testcase_10 AC 120 ms
78,544 KB
testcase_11 AC 115 ms
78,628 KB
testcase_12 AC 103 ms
77,732 KB
testcase_13 AC 104 ms
78,092 KB
testcase_14 AC 123 ms
78,476 KB
testcase_15 AC 110 ms
78,316 KB
testcase_16 AC 89 ms
77,504 KB
testcase_17 AC 90 ms
77,472 KB
testcase_18 AC 88 ms
77,248 KB
testcase_19 AC 98 ms
77,772 KB
testcase_20 AC 89 ms
77,228 KB
testcase_21 AC 91 ms
77,348 KB
testcase_22 AC 127 ms
78,628 KB
testcase_23 AC 132 ms
78,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = [int(input()) for i in range(N)]
A.sort()

odd = any(A[i]%2 for i in range(N))
even = any(not A[i]%2 for i in range(N))

if odd and even:
    for i in range(1,N):
        if A[i] == A[i-1] + 1:
            print(2)
            break
    else:
        print(1)
else:
    print(1)
0