結果
問題 | No.2775 Nuisance Balls |
ユーザー |
|
提出日時 | 2024-06-07 21:45:26 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 46 ms / 2,000 ms |
コード長 | 1,787 bytes |
コンパイル時間 | 108 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,904 KB |
最終ジャッジ日時 | 2024-12-26 07:35:40 |
合計ジャッジ時間 | 2,067 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
import os, sysimport math, decimal, queue, heapq, bisect, itertools, functools, collections, stringfrom bisect import bisect, bisect_leftfrom collections import defaultdict, OrderedDict, deque, Counterfrom functools import cmp_to_key, lru_cache, reducefrom heapq import heapify, heappush, heappushpop, heappop, heapreplace, nlargest, nsmallestfrom itertools import accumulate, chain, combinations, combinations_with_replacement, compress, count, cycle, dropwhile, filterfalse, groupby, islice,permutations, product, repeat, starmap, takewhile, tee, zip_longestfrom math import gcd, factorial, isqrt, comb, perm, prod, inffrom queue import Queue, PriorityQueue, LifoQueuefrom string import ascii_letters, ascii_lowercase, ascii_uppercase, digits, hexdigits, octdigitsLOCAL = sys.argv[0] if '4a' in sys.argv[0] else NoneP = lambda *p: [print(i, end=' ') for i in p] if LOCAL else NonePI = lambda *p: print(' '.join(map(str, p))) or NonePII = lambda X: [PI(*row) for row in X]sys.stdin = open(os.path.join(os.getcwd(), 'a1.txt'), 'r') if LOCAL else sys.stdinI = lambda: [int(a) for l in sys.stdin for a in l.strip().split()]S = lambda: [a for l in sys.stdin for a in l.strip().split()]IM = lambda: [[int(a) for a in l.split()] for l in sys.stdin]SM = lambda: [[a for a in l.split()] for l in sys.stdin]az, AZ, mod = ascii_lowercase, ascii_uppercase, 1_000_000_007A = I()# P(A)def solution(A):D = {'.': 1, 'o': 6, 'R': 30, 'S': 180, 'M': 360, 'C': 720}s = A[0]res = []for k, v in D.items():x, y = divmod(s, v)res += [(x, y, v, k)]res = res[::-1]# P(res)out = ''for x, y, z, ch in res:if (s // z) > 0:out += (s // z) * chs -= (s // z) * zprint(out)solution(A)