質問編集履歴
2
コード変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -18,15 +18,15 @@
|
|
18
18
|
N,M,K=map(int,input().split())
|
19
19
|
A=list(map(int,input().split()))
|
20
20
|
B=list(map(int,input().split()))
|
21
|
+
count=A[0]+sum(B)
|
21
22
|
a=A[0]
|
22
|
-
b=sum(B)
|
23
|
-
count=a+b
|
24
23
|
p=0
|
25
24
|
for i in range(N):
|
26
25
|
while count>K:
|
27
26
|
count-=B[M-1]
|
28
27
|
M-=1
|
29
28
|
if i!=N-1:
|
29
|
+
count+=A[i+1]
|
30
30
|
a+=A[i+1]
|
31
31
|
p=max(p,i+M+1)
|
32
32
|
if a>K:
|
@@ -39,5 +39,4 @@
|
|
39
39
|
|
40
40
|
|
41
41
|
### 補足情報(FW/ツールのバージョンなど)
|
42
|
-
|
43
|
-
|
42
|
+
b09.txt,b19.txtだけWAです。
|
1
インデントがなかった
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,7 +2,10 @@
|
|
2
2
|
|
3
3
|
Atcoder 172 CをPythonで解いたのですがどこが間違っているかわかりません。
|
4
4
|
教えてください。
|
5
|
+
問題文は以下の通りです。
|
5
6
|
|
7
|
+
]
|
8
|
+
|
6
9
|
### 発生している問題・エラーメッセージ
|
7
10
|
|
8
11
|
```
|
@@ -11,8 +14,7 @@
|
|
11
14
|
|
12
15
|
### 該当のソースコード
|
13
16
|
|
14
|
-
Python
|
17
|
+
```Python
|
15
|
-
ソースコード
|
16
18
|
N,M,K=map(int,input().split())
|
17
19
|
A=list(map(int,input().split()))
|
18
20
|
B=list(map(int,input().split()))
|
@@ -30,6 +32,7 @@
|
|
30
32
|
if a>K:
|
31
33
|
break
|
32
34
|
print(p)
|
35
|
+
```
|
33
36
|
|
34
37
|
### 試したこと
|
35
38
|
|