提出 #33103114
ソースコード 拡げる
import sys
input = sys.stdin.readline
import numpy as np
S = [s for s in input().strip()]
T = [t for t in input().strip()]
top = 2 * 10**5
alpha_map_s = []
now_s = S[0]
count_s = 1
for s in S[1:]:
if now_s!=s:
alpha_map_s.append([now_s, count_s])
now_s = s
count_s = 1
else:
count_s+=1
alpha_map_s.append([now_s, count_s])
alpha_map_t = []
now_t = T[0]
count_t = 1
for t in T[1:]:
if now_t!=t:
alpha_map_t.append([now_t, count_t])
now_t = t
count_t = 1
else:
count_t+=1
alpha_map_t.append([now_t, count_t])
if len(alpha_map_s)!=len(alpha_map_t):
print("No")
exit()
for [s, count_s], [t, count_t] in zip(alpha_map_s, alpha_map_t):
if s != t:
print("No")
exit()
if count_s < count_t:
if count_s <= 1:
print("No")
exit()
elif count_s == count_t:
continue
else:
print("No")
exit()
print("Yes")
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - XX to XXX |
| ユーザ | rsypoz |
| 言語 | Python (3.8.2) |
| 得点 | 300 |
| コード長 | 1044 Byte |
| 結果 | AC |
| 実行時間 | 376 ms |
| メモリ | 64816 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 300 / 300 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, example0.txt, example1.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 000.txt | AC | 113 ms | 26836 KiB |
| 001.txt | AC | 157 ms | 31700 KiB |
| 002.txt | AC | 135 ms | 29376 KiB |
| 003.txt | AC | 199 ms | 42332 KiB |
| 004.txt | AC | 282 ms | 54952 KiB |
| 005.txt | AC | 365 ms | 64804 KiB |
| 006.txt | AC | 344 ms | 64808 KiB |
| 007.txt | AC | 376 ms | 64796 KiB |
| 008.txt | AC | 146 ms | 30224 KiB |
| 009.txt | AC | 148 ms | 30668 KiB |
| 010.txt | AC | 151 ms | 30920 KiB |
| 011.txt | AC | 156 ms | 31644 KiB |
| 012.txt | AC | 248 ms | 45644 KiB |
| 013.txt | AC | 356 ms | 61744 KiB |
| 014.txt | AC | 368 ms | 64288 KiB |
| 015.txt | AC | 371 ms | 64456 KiB |
| 016.txt | AC | 147 ms | 30548 KiB |
| 017.txt | AC | 149 ms | 30680 KiB |
| 018.txt | AC | 145 ms | 30696 KiB |
| 019.txt | AC | 152 ms | 30760 KiB |
| 020.txt | AC | 150 ms | 30720 KiB |
| 021.txt | AC | 151 ms | 30716 KiB |
| 022.txt | AC | 155 ms | 30736 KiB |
| 023.txt | AC | 149 ms | 30824 KiB |
| 024.txt | AC | 127 ms | 30520 KiB |
| 025.txt | AC | 253 ms | 51724 KiB |
| 026.txt | AC | 158 ms | 36964 KiB |
| 027.txt | AC | 344 ms | 64700 KiB |
| 028.txt | AC | 337 ms | 64800 KiB |
| 029.txt | AC | 333 ms | 64816 KiB |
| example0.txt | AC | 108 ms | 26568 KiB |
| example1.txt | AC | 106 ms | 26764 KiB |