結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー rocoderrocoder
提出日時 2017-07-16 05:22:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 739 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-16 22:14:03
合計ジャッジ時間 2,781 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 WA -
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 30 ms
10,624 KB
testcase_06 AC 29 ms
10,752 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 29 ms
10,624 KB
testcase_11 RE -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 29 ms
10,752 KB
testcase_16 AC 29 ms
10,752 KB
testcase_17 AC 28 ms
10,752 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 29 ms
10,752 KB
testcase_23 AC 29 ms
10,752 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 RE -
testcase_26 AC 30 ms
10,624 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 WA -
testcase_30 WA -
testcase_31 RE -
testcase_32 AC 29 ms
10,624 KB
testcase_33 AC 30 ms
10,752 KB
testcase_34 AC 30 ms
10,752 KB
testcase_35 AC 29 ms
10,752 KB
testcase_36 RE -
testcase_37 WA -
testcase_38 RE -
testcase_39 AC 29 ms
10,752 KB
testcase_40 AC 29 ms
10,624 KB
testcase_41 AC 28 ms
10,752 KB
testcase_42 AC 27 ms
10,752 KB
testcase_43 AC 27 ms
10,624 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 WA -
testcase_47 AC 28 ms
10,624 KB
testcase_48 AC 28 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#golden week
D=int(input())
C1=input()
C2=input()
C=C1+C2
i=0
Cn=[D]
while i <len(C) and C[i]=="x":
    co+=1
    i+=1
    Cn[0]+= co
while i<len(C):
    co=0
    while i <len(C) and C[i]=="o":
        co+=1
        i+=1
    Cn.append (co)
    co=0
    while i <len(C) and C[i]=="x":
        co+=1
        i+=1
    Cn.append (co)
Cn[-1]+=D
m=0
j=0
#print (Cn)
while j<len(Cn):
    V=D
    i=j
  #  print (i)
    g=0
    while i<len(Cn) and V>=0:
        if i%2==1:
            g+=Cn[i]
     #       print (g)
        elif V>=Cn[i]:
            g+=Cn[i]
            V=0
        elif V>0:
            g+=V
            V=0
        else:
            V=-1
        i+=1
    #    print (D)
 #   print (g)
    if g>m:
        m=g
    j+=1
print(m)
0