結果

問題 No.3420 Letter Loading
コンテスト
ユーザー koheijkt
提出日時 2026-01-11 13:43:09
言語 PyPy3
(7.3.17)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 1,562 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 384 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 62,440 KB
最終ジャッジ日時 2026-01-11 14:03:17
合計ジャッジ時間 1,595 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys, math
sys.setrecursionlimit(10**8)
sys.set_int_max_str_digits(0)
INF = 1e18
MOD = 998244353
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import product, combinations, permutations, groupby, accumulate
from heapq import heapify, heappop, heappush
def I():   return sys.stdin.readline().rstrip()
def II():  return int(sys.stdin.readline().rstrip())
def IS():  return sys.stdin.readline().rstrip().split()
def MII(): return map(int, sys.stdin.readline().rstrip().split())
def LI():  return list(sys.stdin.readline().rstrip())
def TII(): return tuple(map(int, sys.stdin.readline().rstrip().split()))
def LII(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LSI(): return list(map(str, sys.stdin.readline().rstrip().split()))
def GMI(): return list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))
def kiriage(a, b): return (a+b-1)//b
def chmax(DP,i,v):
    if DP[i] < v: DP[i] = v
def chmin(DP,i,v):
    if DP[i] > v: DP[i] = v

N, W, H = MII()
S = I()

from itertools import groupby
def runLengthEncode(S): # list でも str でも OK
    grouped = groupby(S)
    res = []
    for k, v in grouped:
        res.append((k, int(len(list(v)))))
    return res

ans = [['x'] * (H) for _ in range(W)]
data = []
for k, v in runLengthEncode(S):
    if k == 'o':
        data.append(v)

i = 0
for d in data:
    for j in range(d):
        ans[i][j] = 'o'
    ans[i].reverse()
    i += 1

ans2 = [list(x) for x in zip(*ans)]
for a in ans2:
    print(''.join(a))
0