結果
| 問題 | 
                            No.1130 Grid Numbers
                             | 
                    
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-08-17 00:12:30 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 32 ms / 2,000 ms | 
| コード長 | 489 bytes | 
| コンパイル時間 | 84 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-10-11 10:46:16 | 
| 合計ジャッジ時間 | 1,046 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 12 | 
ソースコード
h, w = map(int, input().split())
cnt_s = {}
for i in range(11):
    cnt_s[i] = 0
cnt_s[10] = -1
for _ in range(h):
    row = list(map(int, input().split()))
    for num in row:
        cnt_s[num] += 1
num = 0
cnt = 0
while 0 == cnt_s[num]:
    num += 1
ans = [[0 for _ in range(w)] for _ in range(h)]
for i in range(h):
    for j in range(w):
        ans[i][j] = num
        cnt += 1
        while cnt == cnt_s[num]:
            cnt = 0
            num += 1
for row in ans:
    print(*row)