結果
問題 | No.511 落ちゲー 〜手作業のぬくもり〜 |
ユーザー |
![]() |
提出日時 | 2025-03-26 15:57:14 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,367 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 82,296 KB |
実行使用メモリ | 76,008 KB |
最終ジャッジ日時 | 2025-03-26 15:57:50 |
合計ジャッジ時間 | 8,391 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 24 TLE * 1 -- * 7 |
ソースコード
def main():import sysinput = sys.stdin.read().split()idx = 0n = int(input[idx]); idx +=1w = int(input[idx]); idx +=1h = int(input[idx]); idx +=1# Initialize heightsheights = [0] * (w + 2) # 1-based to wa_scores = 0b_scores = 0game_ended = Falsefor move in range(n):if game_ended:breaka = int(input[idx]); idx +=1b = int(input[idx]); idx +=1x = int(input[idx]); idx +=1L = xR = x + a - 1player = 'A' if (move % 2 == 0) else 'B'current_score = 0A = max(0, h - b)B = h - 1for j in range(L, R+1):prev = heights[j]if prev < h:new = prev + bif new >= h:current_score += 1heights[j] += bif player == 'A':a_scores += current_scoreelse:b_scores += current_score# Check if all columns >= hall_high = Truefor j in range(1, w+1):if heights[j] < h:all_high = Falsebreakif all_high:game_ended = Trueif a_scores > b_scores:print("A")elif b_scores > a_scores:print("B")else:print("DRAW")if __name__ == '__main__':main()