Submission #4065851


Source Code Expand

#include <iostream>
#include <cstring>

using namespace std;

int main() {
	
	char SS[60]="",T[60]="",S[60]="";
	char temp[60]="";
	int i,j,k,len1,len2;
	scanf("%s",SS);
	scanf("%s",T);
	len1=strlen(SS);
	len2=strlen(T);
	k=len1-len2;
	for(i=0;i<=k;i++)
	{
		strncpy(temp,SS+i,len2);
		for(j=0;j<len2;j++)
		{
			if(temp[j]=='?') temp[j]=T[j];
		}
		if(strcmp(temp,T)==0)
		{
			for(j=0;j<i;j++)
			S[j]=SS[j];
			for(j=i;j<len2+i;j++)
			S[j]=T[j-i];
			for(j=len2+i;j<len1;j++)
			S[j]=SS[j];
			for(j=0;j<len1;j++)	
			if(S[j]=='?') S[j]='a';
			S[len1]='\0';
			printf("%s\n",S);
			return 0;		
		}
	}
	printf("UNRESTORABLE\n");
	return 0;
}

Submission Info

Submission Time
Task C - Dubious Document 2
User vjudge3
Language C++14 (GCC 5.4.1)
Score 0
Code Size 645 Byte
Status WA
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",SS);
                ^
./Main.cpp:12:15: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",T);
               ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 11
WA × 3
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 WA 1 ms 256 KB
in02.txt AC 1 ms 256 KB
in03.txt AC 1 ms 256 KB
in04.txt AC 1 ms 256 KB
in05.txt WA 1 ms 256 KB
in06.txt AC 1 ms 256 KB
in07.txt AC 1 ms 256 KB
in08.txt WA 1 ms 256 KB
in09.txt AC 1 ms 256 KB
in10.txt AC 1 ms 256 KB
in11.txt AC 1 ms 256 KB
in12.txt AC 1 ms 256 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB