結果
問題 | No.2374 ASKT Subsequences |
ユーザー | meruuu61779999 |
提出日時 | 2023-07-07 22:10:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 469 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 87,028 KB |
実行使用メモリ | 80,184 KB |
最終ジャッジ日時 | 2023-09-28 23:30:31 |
合計ジャッジ時間 | 4,792 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 78 ms
71,484 KB |
testcase_01 | AC | 79 ms
71,444 KB |
testcase_02 | AC | 78 ms
71,392 KB |
testcase_03 | AC | 78 ms
71,372 KB |
testcase_04 | AC | 79 ms
71,116 KB |
testcase_05 | WA | - |
testcase_06 | AC | 78 ms
71,132 KB |
testcase_07 | AC | 80 ms
71,508 KB |
testcase_08 | WA | - |
testcase_09 | AC | 79 ms
71,264 KB |
testcase_10 | WA | - |
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 | RE | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 98 ms
76,856 KB |
testcase_26 | RE | - |
testcase_27 | RE | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
ソースコード
N = int(input()) A = list(map(int, input().split())) All = [0] * 2001 for a in A: All[a] += 1 ans = 0 for i in range(N - 3): right = All[:] left = [0] * 2001 right[A[i]] -= 1 right[A[i + 1]] -= 1 line = 0 for j in range(i + 2, N - 1): right[A[j]] -= 1 line -= left[A[j] - 1] left[A[j - 1]] += 1 line += right[A[j - 1] + 1] if A[i] + 10 == A[j]: ans += line All[A[i]] -= 1 print(ans)