結果

問題 No.1285 ゴミ捨て
ユーザー kit84
提出日時 2020-11-13 22:11:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 865 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,016 KB
最終ジャッジ日時 2024-11-28 21:47:27
合計ジャッジ時間 2,838 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
enum = enumerate
inf = 1001001001
MOD = 10**9 + 7

import collections
import random
from bisect import bisect_right as bs_r

def linput(ty=int, cvt=list):
	return cvt(map(ty,input().split()))

def vinput(rep=1, ty=int, cvt=list):
	return cvt(ty(input().rstrip()) for _ in range(rep))

def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a

def lcm(a: int, b: int):
	return a * b // gcd(a, b)

def dist(x1,y1,x2,y2):
	return abs(x1-x2)+abs(y1-y2)

#vD = [chr(ord("a")+i) for i in range(26)]

def bye(res):
	sT = "No Yes".split()
	print(sT[res])
	#exit(0)
	
def csum(v):
	vr = [0,]
	s = 0
	for a in v:
		s = (s+a)%MOD		
		vr.append(s)
	return vr

def main():
	N, = linput()
	vA = vinput(N)
	
	vA.sort()

	res = 1
	for p,a in zip(vA,vA[1:]):
		if a-p==1:
			res = 2
			break
	print(res)

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