結果

問題 No.1694 ZerOne
ユーザー ophhdnophhdn
提出日時 2021-10-01 21:54:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,606 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 83,976 KB
最終ジャッジ日時 2023-09-26 17:08:08
合計ジャッジ時間 9,653 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 214 ms
81,248 KB
testcase_01 AC 212 ms
81,320 KB
testcase_02 AC 215 ms
81,072 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 210 ms
80,776 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 211 ms
81,112 KB
testcase_12 AC 211 ms
81,148 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 212 ms
81,324 KB
testcase_19 AC 217 ms
81,248 KB
testcase_20 AC 229 ms
83,692 KB
testcase_21 AC 226 ms
83,472 KB
testcase_22 AC 236 ms
83,392 KB
testcase_23 AC 232 ms
83,472 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 227 ms
83,400 KB
testcase_29 AC 225 ms
83,480 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from copy import deepcopy
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint
from copy import deepcopy
from math import gcd, log2,atan2,atan,sin,cos,pi
import functools
import typing


def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod=10**9+7

INF=10**30

s=S()
n=len(s)
ans={s}

for l_start in range(n):
    for r_start in range(l_start+1,n):
        l_cnt = 0
        r_cnt=0
        for d in range(n-1):
            if l_start+d>=r_start or r_start+d>=n:
                break
            l_cnt+=int(s[l_start+d])
            r_cnt+=int(s[r_start+d])
            if l_cnt==r_cnt:
                l=s[l_start:l_start+d]
                mid=s[l_start+d:r_start]
                r=s[r_start:r_start+d]
                last=s[r_start+d:]
                ns=s[:l_start]+r+mid+l+last
                ans.add(ns)

print(len(ans))







0