結果
問題 | No.1285 ゴミ捨て |
ユーザー | mesame3993 |
提出日時 | 2021-11-18 01:13:35 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 336 bytes |
コンパイル時間 | 281 ms |
コンパイル使用メモリ | 86,800 KB |
実行使用メモリ | 77,876 KB |
最終ジャッジ日時 | 2023-08-25 23:05:46 |
合計ジャッジ時間 | 4,807 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
70,788 KB |
testcase_01 | AC | 74 ms
70,928 KB |
testcase_02 | AC | 73 ms
71,328 KB |
testcase_03 | AC | 72 ms
71,168 KB |
testcase_04 | AC | 72 ms
70,984 KB |
testcase_05 | AC | 73 ms
71,272 KB |
testcase_06 | AC | 73 ms
71,220 KB |
testcase_07 | WA | - |
testcase_08 | AC | 78 ms
76,372 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 | 83 ms
76,136 KB |
testcase_17 | AC | 82 ms
76,328 KB |
testcase_18 | AC | 82 ms
76,056 KB |
testcase_19 | WA | - |
testcase_20 | AC | 81 ms
76,044 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
ソースコード
def main(): from sys import stdin readline=stdin.readline n = int(readline()) A = [int(readline()) for _ in range(n)] A.sort() ans = 1 flag = True for i in range(n-1): if A[i]+1 < A[i+1]: if flag: continue flag = True ans += 1 else: flag = False ans += 1 print(ans) main()