提出 #28147996
ソースコード 拡げる
n,k = map(int,input().split())
a = list(map(int,input().split()))
dp = [[0]*(n+1) for _ in range(n)]
ans = 0
for i in range(n):
j = i
while j < n:
if i == 0:
dp[i][j+1] = dp[i][j] + a[j]
if dp[i][j+1] == k:
ans += 1
else:
dp[i][j+1] = dp[i-1][j+1] - a[j-1]
if dp[i][j+1] == k:
ans += 1
j += 1
print(ans)
提出情報
| 提出日時 | |
|---|---|
| 問題 | D - Count Interval |
| ユーザ | Sirocco110 |
| 言語 | PyPy3 (7.3.0) |
| 得点 | 0 |
| コード長 | 438 Byte |
| 結果 | RE |
| 実行時間 | 2332 ms |
| メモリ | 3547104 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 400 | ||||||||||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, example0.txt, example1.txt, example2.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 000.txt | AC | 67 ms | 61780 KiB |
| 001.txt | AC | 53 ms | 61956 KiB |
| 002.txt | AC | 53 ms | 61844 KiB |
| 003.txt | AC | 57 ms | 64424 KiB |
| 004.txt | AC | 171 ms | 153432 KiB |
| 005.txt | TLE | 2292 ms | 3533536 KiB |
| 006.txt | RE | 2160 ms | 3547104 KiB |
| 007.txt | RE | 2173 ms | 3546128 KiB |
| 008.txt | TLE | 2332 ms | 3537440 KiB |
| 009.txt | TLE | 2329 ms | 3535888 KiB |
| 010.txt | TLE | 2304 ms | 3533004 KiB |
| 011.txt | TLE | 2292 ms | 3534952 KiB |
| 012.txt | TLE | 2293 ms | 3535252 KiB |
| 013.txt | TLE | 2332 ms | 3535340 KiB |
| 014.txt | TLE | 2332 ms | 3533612 KiB |
| 015.txt | TLE | 2329 ms | 3535364 KiB |
| 016.txt | MLE | 1981 ms | 1653564 KiB |
| 017.txt | RE | 2160 ms | 3544264 KiB |
| 018.txt | RE | 2198 ms | 3544600 KiB |
| 019.txt | RE | 2167 ms | 3543376 KiB |
| 020.txt | RE | 2203 ms | 3544428 KiB |
| 021.txt | TLE | 2243 ms | 3543988 KiB |
| 022.txt | TLE | 2292 ms | 3535956 KiB |
| 023.txt | TLE | 2329 ms | 3532824 KiB |
| 024.txt | TLE | 2328 ms | 3536920 KiB |
| 025.txt | TLE | 2291 ms | 3535576 KiB |
| 026.txt | TLE | 2292 ms | 3534652 KiB |
| 027.txt | TLE | 2292 ms | 3536444 KiB |
| example0.txt | WA | 219 ms | 86392 KiB |
| example1.txt | AC | 48 ms | 61636 KiB |
| example2.txt | WA | 51 ms | 61756 KiB |