結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 34 ms
10,752 KB
testcase_03 AC 33 ms
10,752 KB
testcase_04 AC 32 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 31 ms
10,624 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 31 ms
10,752 KB
testcase_11 RE -
testcase_12 AC 30 ms
10,624 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 30 ms
10,752 KB
testcase_16 AC 30 ms
10,624 KB
testcase_17 AC 30 ms
10,752 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 30 ms
10,752 KB
testcase_23 AC 30 ms
10,752 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 RE -
testcase_26 AC 30 ms
10,752 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 31 ms
10,752 KB
testcase_30 AC 30 ms
10,880 KB
testcase_31 RE -
testcase_32 AC 31 ms
10,752 KB
testcase_33 AC 31 ms
10,624 KB
testcase_34 AC 31 ms
10,880 KB
testcase_35 AC 30 ms
10,624 KB
testcase_36 RE -
testcase_37 AC 30 ms
10,752 KB
testcase_38 RE -
testcase_39 AC 31 ms
10,752 KB
testcase_40 AC 31 ms
10,624 KB
testcase_41 AC 31 ms
10,752 KB
testcase_42 AC 30 ms
10,624 KB
testcase_43 AC 31 ms
10,624 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 AC 30 ms
10,752 KB
testcase_47 AC 30 ms
10,752 KB
testcase_48 AC 31 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:
            if g==0:
                g+=V
                V=0
            else:
                g+=V
                V=-1
        else:
            V=-1
        i+=1
   #     print (g)
 #   print (g)
    if g>m:
        m=g
    j+=1
print(m)
0