結果

問題 No.2374 ASKT Subsequences
ユーザー 👑 H20H20
提出日時 2023-07-07 21:56:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 436 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 88,804 KB
最終ジャッジ日時 2023-09-28 23:07:34
合計ジャッジ時間 7,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,732 KB
testcase_01 AC 94 ms
71,480 KB
testcase_02 AC 94 ms
71,852 KB
testcase_03 AC 95 ms
71,360 KB
testcase_04 AC 94 ms
71,504 KB
testcase_05 WA -
testcase_06 AC 93 ms
71,560 KB
testcase_07 AC 93 ms
71,860 KB
testcase_08 AC 92 ms
71,660 KB
testcase_09 AC 94 ms
71,760 KB
testcase_10 AC 98 ms
76,800 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
import bisect
N = int(input())
A = list(map(int, input().split())) 
ans = 0
#a1
#a2=a1+k+10
#a3=a1+10
#a4=a1+k+10+1=a2+1
A13 = []
A24 = []
for i in range(N):
    for j in range(i+1,N):
        if A[i]==A[j]-10:
            A13.append([i,j])
        if A[i]==A[j]-1:
            A24.append([i,j])
ans = 0
for a1,a3 in A13:
    for a2,a4 in A24:
        if a1<a2<a3<a4 and A[a1]<A[a2]+10:
            ans+=1
print(ans)
0