#B3713. Contest Submission Directory Check
Contest Submission Directory Check
Contest Submission Directory Check
During a full-scale simulation contest with n contestants and m problems, many participants submitted their source codes with various directory structure mistakes. The only correct submission directory for a contestant with exam number X on problem Y is given by the following structure:
$$ X.zip/X/Y/Y.cpp $$
Any deviation from this structure (e.g. misspelling of file or directory names, additional nested folders, wrong extensions, etc.) is considered incorrect. For each contestant and for each problem, you are given the submission directory string. Your task is to check whether the directory structure is exactly correct.
inputFormat
The input begins with a line containing two integers n and m where:
- n is the number of contestants.
- m is the number of problems.
The second line contains m problem names separated by spaces.
This is followed by n blocks, one for each contestant. For each contestant:
- The first line contains the contestant's exam number (denoted as X).
- The next m lines each contain a problem name Y and a string representing the submitted directory structure, separated by a space.
The correct directory structure for a given contestant X and problem Y must be exactly:
$$ X.zip/X/Y/Y.cpp $$
outputFormat
For each submission (in the same order as input), output a line containing YES if the directory structure is correct, otherwise output NO.
sample
2 2
A B
12345
A 12345.zip/12345/A/A.cpp
B 12345.zip/12345/B/B.cpp
54321
A 54321_zip/54321/A/A.cpp
B 54321.zip/54321/B/B.cpp
YES
YES
NO
YES
</p>