結果

問題 No.1285 ゴミ捨て
ユーザー kit84kit84
提出日時 2020-11-13 22:11:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 865 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 13,788 KB
最終ジャッジ日時 2023-08-19 07:17:44
合計ジャッジ時間 2,439 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
9,112 KB
testcase_01 AC 20 ms
9,044 KB
testcase_02 AC 21 ms
9,164 KB
testcase_03 AC 20 ms
9,076 KB
testcase_04 AC 21 ms
9,132 KB
testcase_05 AC 21 ms
9,128 KB
testcase_06 AC 20 ms
9,072 KB
testcase_07 AC 82 ms
13,636 KB
testcase_08 AC 23 ms
9,220 KB
testcase_09 AC 47 ms
11,084 KB
testcase_10 AC 74 ms
12,960 KB
testcase_11 AC 72 ms
12,812 KB
testcase_12 AC 58 ms
11,728 KB
testcase_13 AC 57 ms
11,768 KB
testcase_14 AC 80 ms
13,348 KB
testcase_15 AC 64 ms
11,972 KB
testcase_16 AC 33 ms
10,000 KB
testcase_17 AC 33 ms
9,852 KB
testcase_18 AC 32 ms
9,900 KB
testcase_19 AC 45 ms
10,892 KB
testcase_20 AC 31 ms
9,772 KB
testcase_21 AC 35 ms
10,144 KB
testcase_22 AC 85 ms
13,788 KB
testcase_23 AC 86 ms
13,624 KB
権限があれば一括ダウンロードができます

ソースコード

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