結果
| 問題 |
No.1694 ZerOne
|
| コンテスト | |
| ユーザー |
ophhdn
|
| 提出日時 | 2021-10-01 21:54:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,606 bytes |
| コンパイル時間 | 155 ms |
| コンパイル使用メモリ | 82,408 KB |
| 実行使用メモリ | 82,100 KB |
| 最終ジャッジ日時 | 2024-07-19 11:08:13 |
| 合計ジャッジ時間 | 4,977 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 20 |
ソースコード
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))
ophhdn