結果

問題 No.1765 While Shining
ユーザー MasKoaTSMasKoaTS
提出日時 2022-01-05 22:48:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 776 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 123,580 KB
最終ジャッジ日時 2024-04-24 03:26:35
合計ジャッジ時間 8,582 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
93,468 KB
testcase_01 AC 138 ms
86,932 KB
testcase_02 AC 130 ms
86,528 KB
testcase_03 AC 134 ms
86,432 KB
testcase_04 AC 131 ms
86,912 KB
testcase_05 AC 135 ms
86,956 KB
testcase_06 AC 134 ms
86,912 KB
testcase_07 AC 134 ms
86,800 KB
testcase_08 AC 138 ms
86,836 KB
testcase_09 AC 167 ms
105,184 KB
testcase_10 AC 181 ms
116,188 KB
testcase_11 AC 172 ms
110,000 KB
testcase_12 AC 179 ms
113,136 KB
testcase_13 AC 180 ms
110,084 KB
testcase_14 AC 174 ms
116,856 KB
testcase_15 AC 178 ms
116,804 KB
testcase_16 AC 181 ms
116,868 KB
testcase_17 AC 182 ms
116,604 KB
testcase_18 AC 179 ms
116,808 KB
testcase_19 AC 179 ms
116,800 KB
testcase_20 AC 181 ms
116,156 KB
testcase_21 AC 178 ms
116,256 KB
testcase_22 AC 180 ms
116,884 KB
testcase_23 AC 180 ms
116,584 KB
testcase_24 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from copy import deepcopy as dcopy
import math
import sys
sys.setrecursionlimit(10**6)
def input():
    return sys.stdin.readline().rstrip()
def getN():
	return int(sys.stdin.readline())
def getNs():
	return map(int,sys.stdin.readline().split())
def getList():
	return list(map(int,sys.stdin.readline().split()))
def strinps(n):
	return [sys.stdin.readline().rstrip() for _ in range(n)]
pi = 3.141592653589793
mod = 10**9+7
MOD = 998244353
INF = math.inf
dx = [1,0,-1,0];	dy = [0,1,0,-1]


"""
Main Code
"""

n = getN()
a = getList()
ans = 0
for s in range(n-1):
	x = s
	p = 0
	while(x < n - 1 and a[x] ^ p):
		ans += 1
		p ^= 1
		x += 1
print(ans)
0