結果
| 問題 |
No.455 冬の大三角
|
| コンテスト | |
| ユーザー |
kichirb3
|
| 提出日時 | 2018-03-29 20:00:38 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 953 bytes |
| コンパイル時間 | 226 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-06-25 23:50:22 |
| 合計ジャッジ時間 | 4,160 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 53 WA * 1 |
ソースコード
# -*- coding: utf-8 -*-
"""
No.455 冬の大三角
https://yukicoder.me/problems/no/455
"""
import sys
from sys import stdin
input = stdin.readline
def solve(stars, fields, H, W):
x1, y1 = stars[0][0], stars[0][1]
x2, y2 = stars[1][0], stars[1][1]
x0, y0 = 0, 0
if x1 == x2:
x0 = x1 - 1
if x0 < 0:
x0 = x1 + 1
y0 = (y1 + y2) // 2
else:
y0 = y1 -1
if y0 < 0:
y0 = y1 + 1
x0 = (x1 + x2) // 2
fields[y0][x0] = '*'
def main(args):
H, W = map(int, input().split())
stars = []
fields = [['-'] * W for _ in range(H)]
for y in range(H):
row = input().strip()
for x, r in enumerate(row):
if r == '*':
stars.append([x, y])
fields[y][x] = '*'
ans = solve(stars, fields, H, W)
for row in fields:
print(*row, sep='')
if __name__ == '__main__':
main(sys.argv[1:])
kichirb3