結果

問題 No.2035 Tunnel
ユーザー asumo0729asumo0729
提出日時 2022-08-12 21:50:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 937 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,812 KB
実行使用メモリ 81,140 KB
最終ジャッジ日時 2023-10-24 09:35:57
合計ジャッジ時間 3,374 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
61,052 KB
testcase_01 AC 51 ms
61,052 KB
testcase_02 AC 51 ms
61,052 KB
testcase_03 AC 52 ms
61,052 KB
testcase_04 AC 52 ms
61,052 KB
testcase_05 AC 72 ms
80,260 KB
testcase_06 AC 75 ms
80,664 KB
testcase_07 AC 73 ms
81,140 KB
testcase_08 AC 69 ms
79,592 KB
testcase_09 AC 69 ms
79,588 KB
testcase_10 AC 70 ms
79,908 KB
testcase_11 AC 69 ms
78,060 KB
testcase_12 AC 74 ms
80,368 KB
testcase_13 AC 57 ms
66,548 KB
testcase_14 AC 59 ms
67,684 KB
testcase_15 AC 70 ms
78,552 KB
testcase_16 AC 65 ms
74,816 KB
testcase_17 AC 53 ms
63,824 KB
testcase_18 AC 56 ms
64,324 KB
testcase_19 AC 62 ms
70,164 KB
testcase_20 AC 69 ms
78,152 KB
testcase_21 AC 59 ms
70,504 KB
testcase_22 AC 60 ms
70,596 KB
testcase_23 AC 56 ms
64,812 KB
testcase_24 AC 62 ms
71,784 KB
testcase_25 AC 64 ms
74,924 KB
testcase_26 AC 64 ms
74,560 KB
testcase_27 AC 71 ms
78,824 KB
testcase_28 AC 61 ms
70,756 KB
testcase_29 AC 57 ms
64,868 KB
testcase_30 AC 56 ms
64,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
from heapq import heapify, heappop, _heapify_max, heappush
from bisect import bisect_left, bisect_right
import math
import itertools
import copy

stdin=sys.stdin
#sys.setrecursionlimit(10 ** 7)
## import pypyjit
## pypyjit.set_param('max_unroll_recursion=-1')

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
inf = float('inf')
mod = 10 ** 9 + 7
mod = 998244353
eps = 1e-9
sortkey1 = itemgetter(0)
sortkey2 = lambda x: (x[0], x[1])



###############################################################

N = ip()
S = list(sp())
S = S[::-1]
ans = -1
for i in range(N):
    if S[i] == '#':
        x = i + 1
        if x <= ans + 1:
            ans += 2
        else:
            ans = i + 1
print(ans)
0