結果
問題 | No.455 冬の大三角 |
ユーザー |
![]() |
提出日時 | 2016-12-10 16:14:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 638 bytes |
コンパイル時間 | 335 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-29 00:46:58 |
合計ジャッジ時間 | 4,521 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 WA * 4 |
ソースコード
# データ入力h, w = map(int, input().split())star_pos = dict()count = 1sky = list()for row in range(h):s = input()for i, elm in enumerate(s):if elm == '*':star_pos[count] = (row, i)count += 1sky.append(list(s))# 星の追加候補は(0, 0), (1, 0), (0, 1)の3つif star_pos[1][0] == star_pos[2][0]:if star_pos[1][0] != 0:x, y = 0, 0else:x, y = 0, 1elif star_pos[1][1] == star_pos[2][1]:if star_pos[1][1] != 0:x, y = 0, 0else:x, y = 1, 0elif star_pos[1][1]*star_pos[2][0] == star_pos[2][1]*star_pos[1][0]:x, y = 0, 0else:x, y = 0, 0sky[y][x] = '*'for s in sky:print(''.join(s))