Submission #2866155
Source Code Expand
# coding: utf-8 # Your code here! Sprime = input() T = input() def index(s, t): i = len(t) - 1 j = len(s) - 1 while j >= 0: if s[j] == t[i] or s[j] == "?": if i == 0: return j break else: i -= 1 else: i = len(t) - 1 if j == 0: return -1 break else: j -= 1 def password(s = Sprime, t = T): i = index(s, t) if i == -1: print("UNRESTORABLE") else: new_s = [] for j in range(len(s)): if j - i in range(len(t)): new_s.append(t[j-i]) elif s[j] == "?": new_s.append("a") else: new_s.append(s[j]) print("".join(new_s)) password()
Submission Info
Submission Time | |
---|---|
Task | C - Dubious Document 2 |
User | taoki |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 876 Byte |
Status | WA |
Exec Time | 17 ms |
Memory | 3064 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in01.txt | AC | 17 ms | 3064 KB |
in02.txt | AC | 17 ms | 3064 KB |
in03.txt | AC | 17 ms | 3064 KB |
in04.txt | AC | 17 ms | 3064 KB |
in05.txt | WA | 17 ms | 3064 KB |
in06.txt | AC | 17 ms | 3064 KB |
in07.txt | AC | 17 ms | 3064 KB |
in08.txt | AC | 17 ms | 3064 KB |
in09.txt | AC | 17 ms | 3064 KB |
in10.txt | AC | 17 ms | 3064 KB |
in11.txt | AC | 17 ms | 3064 KB |
in12.txt | AC | 17 ms | 3064 KB |
s1.txt | AC | 17 ms | 3064 KB |
s2.txt | AC | 17 ms | 3064 KB |