QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#726665#5680. You You See What?Nika#WA 15ms10448kbPython3454b2024-11-09 05:14:562024-11-09 05:14:57

Judging History

你现在查看的是最新测评结果

  • [2024-11-09 05:14:57]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10448kb
  • [2024-11-09 05:14:56]
  • 提交

answer

def same(p1, p2):
	p2 = [p2[1], p2[0]]
	# print(p1, p2)
	return p1[0].lower() == p2[0].lower() and p1[1].lower() == p2[1].lower()

s = input().split("!")
nodes = []
edges = []
nodes.append(s[0])
for t in s[1]:
	newedge = [nodes[-1], t]
	if (nodes[-1] == t): continue
	# print(newedge)
	if len(edges) > 0 and same(edges[-1], newedge):
		edges.pop()
		nodes.pop()
	else:
		edges.append(newedge)
		nodes.append(t)

print('!'.join(nodes))

详细

Test #1:

score: 0
Wrong Answer
time: 15ms
memory: 10448kb

input:

texasam!rice!baylor!csdept!baylor!rice!dev!bresearch!bpoucher

output:

texasam!r!i!c!e

result:

wrong answer 1st lines differ - expected: 'texasam!rice!dev!bresearch!bpoucher', found: 'texasam!r!i!c!e'