結果

問題 No.2053 12345...
ユーザー 👑 p-adicp-adic
提出日時 2023-05-24 07:27:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 126 bytes
コンパイル時間 1,134 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 29,920 KB
最終ジャッジ日時 2023-08-25 01:35:01
合計ジャッジ時間 5,916 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,788 KB
testcase_01 AC 15 ms
7,928 KB
testcase_02 AC 16 ms
8,016 KB
testcase_03 AC 38 ms
12,704 KB
testcase_04 AC 83 ms
22,816 KB
testcase_05 AC 30 ms
11,064 KB
testcase_06 AC 75 ms
21,116 KB
testcase_07 AC 59 ms
17,280 KB
testcase_08 AC 55 ms
16,420 KB
testcase_09 AC 86 ms
22,984 KB
testcase_10 AC 109 ms
28,304 KB
testcase_11 AC 29 ms
10,976 KB
testcase_12 AC 24 ms
9,700 KB
testcase_13 AC 119 ms
27,324 KB
testcase_14 AC 50 ms
13,996 KB
testcase_15 AC 40 ms
13,220 KB
testcase_16 AC 42 ms
12,960 KB
testcase_17 AC 33 ms
11,340 KB
testcase_18 AC 125 ms
29,600 KB
testcase_19 AC 88 ms
23,748 KB
testcase_20 AC 22 ms
9,568 KB
testcase_21 AC 62 ms
17,108 KB
testcase_22 AC 16 ms
8,184 KB
testcase_23 AC 26 ms
10,272 KB
testcase_24 AC 42 ms
13,476 KB
testcase_25 AC 108 ms
27,416 KB
testcase_26 AC 59 ms
17,120 KB
testcase_27 AC 41 ms
13,340 KB
testcase_28 AC 35 ms
12,092 KB
testcase_29 AC 77 ms
20,756 KB
testcase_30 AC 37 ms
12,740 KB
testcase_31 AC 72 ms
20,092 KB
testcase_32 AC 123 ms
29,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I=input
N,A=I(),list(map(int,I().split()))+[0]
a=0
c=1
t=-1
for e in A:
	if e==t+1:c+=1
	else:a,c=a+c*(c-1)//2,1
	t=e
print(a)
0