結果
問題 |
No.1268 Fruit Rush 2
|
ユーザー |
|
提出日時 | 2020-10-31 17:59:00 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 275 bytes |
コンパイル時間 | 329 ms |
コンパイル使用メモリ | 82,148 KB |
実行使用メモリ | 146,060 KB |
最終ジャッジ日時 | 2024-07-22 05:06:56 |
合計ジャッジ時間 | 8,851 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 TLE * 1 -- * 4 |
ソースコード
n = int(input()) a = list(map(int,input().split())) a.sort() dic = {} for i in a: dic[i] = 1 ans = n for i in range(1,n): if a[i] == a[i-1]+1: count = 0 k = a[i] while k+count*2 in dic: count += 1 ans += count print(ans)