Submission #11617444
Source Code Expand
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return list(map(float, input().split())) def LI_(): return list(map(lambda x: int(x)-1, input().split())) def II(): return int(input()) def IF(): return float(input()) def S(): return input().rstrip() def LS(): return S().split() def IR(n): return [II() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] def FR(n): return [IF() for _ in range(n)] def LFR(n): return [LI() for _ in range(n)] def LIR_(n): return [LI_() for _ in range(n)] def SR(n): return [S() for _ in range(n)] def LSR(n): return [LS() for _ in range(n)] mod = 1000000007 inf = 1e10 #solve def solve(): s = S() ans = len(s) * (len(s) - 1) for i in range(1, len(s) - 1): if s[i] == "U": ans += i else: ans += len(s) - i - 1 print(ans) return #main if __name__ == '__main__': solve()
Submission Info
Submission Time | |
---|---|
Task | B - Evilator |
User | horiso0921 |
Language | PyPy3 (2.4.0) |
Score | 400 |
Code Size | 1185 Byte |
Status | AC |
Exec Time | 192 ms |
Memory | 40688 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 192 ms | 40688 KB |
02.txt | AC | 186 ms | 39792 KB |
03.txt | AC | 187 ms | 39920 KB |
04.txt | AC | 186 ms | 39920 KB |
05.txt | AC | 184 ms | 39792 KB |
06.txt | AC | 186 ms | 39792 KB |
07.txt | AC | 186 ms | 39792 KB |
08.txt | AC | 186 ms | 39792 KB |
09.txt | AC | 180 ms | 38512 KB |
10.txt | AC | 181 ms | 38512 KB |
s1.txt | AC | 185 ms | 38384 KB |
s2.txt | AC | 184 ms | 38512 KB |