結果

問題 No.3657 Gathering Stones
コンテスト
ユーザー norioc
提出日時 2026-08-30 16:22:26
言語 PyPy3
(7.3.23)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 88 ms / 2,000 ms
+ 13µs
コード長 359 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 230 ms
コンパイル使用メモリ 96,108 KB
実行使用メモリ 84,480 KB
最終ジャッジ日時 2026-08-30 16:22:35
合計ジャッジ時間 6,582 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N, M = map(int, input().split())

cols = [0] * M
for _ in range(N):
    S = input()
    for i, c in enumerate(S):
        if c == '#':
            cols[i] += 1

for i in range(N):
    t = sum(1 for x in cols if x > 0)
    cs = ['#'] * t
    cs += ['.'] * (M - t)
    print(*cs, sep='')

    for j in range(M):
        if cols[j] > 0:
            cols[j] -= 1
0