結果
| 問題 |
No.2035 Tunnel
|
| コンテスト | |
| ユーザー |
sotanishy
|
| 提出日時 | 2022-08-12 21:31:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 2,000 ms |
| コード長 | 306 bytes |
| コンパイル時間 | 256 ms |
| コンパイル使用メモリ | 82,224 KB |
| 実行使用メモリ | 63,360 KB |
| 最終ジャッジ日時 | 2024-09-23 01:02:05 |
| 合計ジャッジ時間 | 2,718 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
import sys
input = sys.stdin.readline
N = int(input())
S = input().rstrip()
ans = 0
x = 0
for i in range(N)[::-1]:
if S[i] == '.':
if i < N-1 and S[i+1] == '.':
x = max(0, x - 1)
continue
if i < N-1 and S[i+1] == '#':
x += 1
ans = max(ans, N-i+x)
print(ans)
sotanishy