引
引言
Unregistered / Unconfirmed
GUEST, unregistred user!
Problem B : Kasperkey
Time Limit: 1000 MS Memory Limit: 65536 K
Description
In computers, a virus is a program or programming code that replicates by being copied or initiating its copying to another program, computer boot sector ordo
cument. Viruses can be transmitted as attachments to an e-mail note or in ado
wnloaded file, or be present on a diskette or CD. The immediate source of the e-mail note,do
wnloaded file, or diskette you've received is usually unaware that it contains a virus. Some viruses wreak their effect as soon as their code is executed;
other viruses liedo
rmant until circumstances cause their code to be executed by the computer. Some viruses are benign or playful in intent and effect ("Happy Birthday, asky007!") and some can be quite harmful, erasing data or causing your hard disk to require reformatting. A virus that replicates itself by resending itself as an e-mail attachment or as part of a network message is known as a worm.
To protect their system from virus, people usually install Anti-Virus softwares.This is a big problem to asky007. He likes Kaspersky Anti-Virus ,but it costs too mush computer resource. Unfortunately, asky007's CPU is PIII 433, and it is impossible to run Kaspersky. So , asky007 wants to develop a Anti-Virus software, he calls it Kasperkey.
When asky007 tests Kasperkey, he finds a new problem. Some viruses use a technical name 'olymorphic code' to let AV can't find them. Viruses can be change their code in different times.For example , a virus'code is 'asky007' now and may be '007asky' an hour later.Thank Godness! Asky007 finds a rule. He captures the virus two times, and marks the shadinesses.For example , it is :
ID Shadiness
The First Time The Second Time
1 1 111
2 10111 10
3 10 0
The rule is if you make a sequence use the ID, the shadiness of two times may be same.Just like '2113'. The first time 's Shadiness become '101111110', sodo
the second time. Now, you can say it is a virus. If can's find a such sequence or the shadiness's length is bigger than 100, you can suppose it can't be a virus.
Input
The first line of the input file contains the number N , the number of IDs, then
followed by 2N lines.The first N lines mean the first time's shadiness, and then
the second.Process to the end of file.
Process to the end of file.
Input
The first line of the input file contains the number N , the number of IDs, then
followed by 2N lines.The first N lines mean the first time's shadiness, and then
the second.Process to the end of file.
Process to the end of file.
Output
If it exists some sequence descripted above, output the shortest ID sequence;
otherwise output “It is not a virus.” In one line.
Sample Input
3
1
10111
10
111
10
0
3
10
10111
1
111
10
0
Sample Output
2113
It is not a virus.
Time Limit: 1000 MS Memory Limit: 65536 K
Description
In computers, a virus is a program or programming code that replicates by being copied or initiating its copying to another program, computer boot sector ordo
cument. Viruses can be transmitted as attachments to an e-mail note or in ado
wnloaded file, or be present on a diskette or CD. The immediate source of the e-mail note,do
wnloaded file, or diskette you've received is usually unaware that it contains a virus. Some viruses wreak their effect as soon as their code is executed;
other viruses liedo
rmant until circumstances cause their code to be executed by the computer. Some viruses are benign or playful in intent and effect ("Happy Birthday, asky007!") and some can be quite harmful, erasing data or causing your hard disk to require reformatting. A virus that replicates itself by resending itself as an e-mail attachment or as part of a network message is known as a worm.
To protect their system from virus, people usually install Anti-Virus softwares.This is a big problem to asky007. He likes Kaspersky Anti-Virus ,but it costs too mush computer resource. Unfortunately, asky007's CPU is PIII 433, and it is impossible to run Kaspersky. So , asky007 wants to develop a Anti-Virus software, he calls it Kasperkey.
When asky007 tests Kasperkey, he finds a new problem. Some viruses use a technical name 'olymorphic code' to let AV can't find them. Viruses can be change their code in different times.For example , a virus'code is 'asky007' now and may be '007asky' an hour later.Thank Godness! Asky007 finds a rule. He captures the virus two times, and marks the shadinesses.For example , it is :
ID Shadiness
The First Time The Second Time
1 1 111
2 10111 10
3 10 0
The rule is if you make a sequence use the ID, the shadiness of two times may be same.Just like '2113'. The first time 's Shadiness become '101111110', sodo
the second time. Now, you can say it is a virus. If can's find a such sequence or the shadiness's length is bigger than 100, you can suppose it can't be a virus.
Input
The first line of the input file contains the number N , the number of IDs, then
followed by 2N lines.The first N lines mean the first time's shadiness, and then
the second.Process to the end of file.
Process to the end of file.
Input
The first line of the input file contains the number N , the number of IDs, then
followed by 2N lines.The first N lines mean the first time's shadiness, and then
the second.Process to the end of file.
Process to the end of file.
Output
If it exists some sequence descripted above, output the shortest ID sequence;
otherwise output “It is not a virus.” In one line.
Sample Input
3
1
10111
10
111
10
0
3
10
10111
1
111
10
0
Sample Output
2113
It is not a virus.