結果

問題 No.1285 ゴミ捨て
ユーザー mesame3993mesame3993
提出日時 2021-11-18 01:15:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 235 bytes
コンパイル時間 693 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 78,312 KB
最終ジャッジ日時 2023-08-25 23:07:56
合計ジャッジ時間 3,815 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,160 KB
testcase_01 AC 74 ms
71,372 KB
testcase_02 AC 71 ms
71,144 KB
testcase_03 AC 73 ms
71,236 KB
testcase_04 AC 74 ms
71,016 KB
testcase_05 AC 71 ms
71,020 KB
testcase_06 AC 72 ms
71,176 KB
testcase_07 WA -
testcase_08 AC 76 ms
76,248 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 81 ms
76,200 KB
testcase_17 AC 83 ms
76,452 KB
testcase_18 AC 80 ms
76,408 KB
testcase_19 WA -
testcase_20 AC 81 ms
76,400 KB
testcase_21 AC 83 ms
76,248 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  from sys import stdin
  readline=stdin.readline
  n = int(readline())
  A = [int(readline()) for _ in range(n)]
  A.sort()
  cnt = 0
  for i in range(n-1):
    if A[i+1] - A[i] <= 2:
      cnt += 1
  print(cnt + 1)
main()
0