QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#209008#5680. You You See What?legendarysasWA 10ms8008kbPython3425b2023-10-10 02:08:592023-10-10 02:08:59

Judging History

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

  • [2023-10-10 02:08:59]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:8008kb
  • [2023-10-10 02:08:59]
  • 提交

answer

import sys 

input = sys.stdin.readline


if __name__ == "__main__":
    bangs = input().split("!")
    skips = {}

    for i in range(len(bangs)):
        skips[bangs[i].lower()] = i
    final = []
    i = 0
    while i < len(bangs):
        final.append(bangs[i])
        if skips[bangs[i].lower()] > i:
            i = skips[bangs[i].lower()]
        i += 1
    print("!".join(final))
    # print(skips)
    # print(bangs)

详细

Test #1:

score: 100
Accepted
time: 10ms
memory: 7916kb

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: 5ms
memory: 8008kb

input:

texasam!Rice!baYlor!csdept!BayloR!dev!Rice!bresearch!bpoucher

output:

texasam!Rice!bresearch!bpoucher


result:

wrong answer 1st lines differ - expected: 'texasam!Rice!baYlor!dev!Rice!bresearch!bpoucher', found: 'texasam!Rice!bresearch!bpoucher'