結果
| 問題 | No.3015 右に寄せろ! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-22 00:10:26 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 443 ms / 2,000 ms |
| + 189µs | |
| コード長 | 461 bytes |
| 記録 | |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 64,304 KB |
| 実行使用メモリ | 297,572 KB |
| 最終ジャッジ日時 | 2026-11-15 20:02:36 |
| 合計ジャッジ時間 | 6,286 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 37 |
ソースコード
S=list(map(int, input()))
res=[]
row=[]
row.append(S[0])
for i in range(1, len(S)):
if S[i] == S[i-1]:
row.append(S[i])
else:
res.append(row)
row=[S[i]]
res.append(row)
count=0
ans=0
p=0
for num,i in enumerate(res):
if i[0] == 1:
count += len(i)
else:
if count == 1:
count=0
continue
if count%2 == 0:
ans += (count//2)*len(i)
else:
ans += (count//2)*len(i)
count -= 1
print(ans)