QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#744954 | #5680. You You See What? | MattTheNub# | WA | 12ms | 10488kb | Python3 | 625b | 2024-11-14 00:41:35 | 2024-11-14 00:41:35 |
Judging History
answer
s = input()
path = s.split("!")
res = []
for i in range(len(path)):
adj = []
if i > 0:
adj.append(path[i - 1].lower())
if i < len(path) - 1:
adj.append(path[i + 1].lower())
for j in range(i):
if path[j].lower() != path[i].lower():
continue
ok = False
if j > 0 and path[j - 1].lower() in adj:
ok = True
if j < len(path) - 1 and path[j + 1].lower() in adj:
ok = True
if ok:
while j in res:
res.pop()
res.append(i)
print("!".join(map(lambda i: path[i], res)))
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 12ms
memory: 10488kb
input:
texasam!rice!baylor!csdept!baylor!rice!dev!bresearch!bpoucher
output:
texasam!rice!dev!bresearch!bpoucher
result:
ok single line: 'texasam!rice!dev!bresearch!bpoucher'
Test #2:
score: -100
Wrong Answer
time: 10ms
memory: 10452kb
input:
texasam!Rice!baYlor!csdept!BayloR!dev!Rice!bresearch!bpoucher
output:
texasam!Rice!BayloR!dev!Rice!bresearch!bpoucher
result:
wrong answer 1st lines differ - expected: 'texasam!Rice!baYlor!dev!Rice!bresearch!bpoucher', found: 'texasam!Rice!BayloR!dev!Rice!bresearch!bpoucher'