結果

問題 No.1535 五七五
ユーザー ytftytft
提出日時 2022-03-22 12:00:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 405 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 674 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 243,504 KB
最終ジャッジ日時 2024-04-18 09:02:01
合計ジャッジ時間 6,019 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,352 KB
testcase_01 AC 38 ms
51,584 KB
testcase_02 AC 34 ms
52,224 KB
testcase_03 AC 40 ms
51,840 KB
testcase_04 AC 286 ms
224,904 KB
testcase_05 AC 336 ms
232,004 KB
testcase_06 AC 312 ms
226,436 KB
testcase_07 AC 36 ms
52,224 KB
testcase_08 AC 40 ms
52,096 KB
testcase_09 AC 36 ms
51,968 KB
testcase_10 AC 41 ms
51,968 KB
testcase_11 AC 37 ms
51,840 KB
testcase_12 AC 39 ms
51,968 KB
testcase_13 AC 39 ms
52,096 KB
testcase_14 AC 32 ms
52,352 KB
testcase_15 AC 39 ms
52,156 KB
testcase_16 AC 36 ms
52,224 KB
testcase_17 AC 39 ms
51,968 KB
testcase_18 AC 405 ms
243,488 KB
testcase_19 AC 400 ms
243,236 KB
testcase_20 AC 357 ms
243,220 KB
testcase_21 AC 371 ms
243,356 KB
testcase_22 AC 349 ms
243,504 KB
testcase_23 AC 372 ms
243,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
N=int(input())
a=list(map(int,input().split()))
for i in range(1,3):
	a[i]+=a[i-1]
ans=0
S=[0]+list(map(len,input().split()))
for i in range(1,N+1):
	S[i]+=S[i-1]
S=set(S)
for i in S:
	ans+=all([(i+j in S) for j in a])
print(ans)
0