CF61B.Hard Work
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
After the contest in comparing numbers, Shapur's teacher found out that he is a real genius and that no one could possibly do the calculations faster than him even using a super computer!
Some days before the contest, the teacher took a very simple-looking exam and all his n students took part in the exam. The teacher gave them 3 strings and asked them to concatenate them. Concatenating strings means to put them in some arbitrary order one after the other. For example from concatenating Alireza and Amir we can get to AlirezaAmir or AmirAlireza depending on the order of concatenation.
Unfortunately enough, the teacher forgot to ask students to concatenate their strings in a pre-defined order so each student did it the way he/she liked.
Now the teacher knows that Shapur is such a fast-calculating genius boy and asks him to correct the students' papers.
Shapur is not good at doing such a time-taking task. He rather likes to finish up with it as soon as possible and take his time to solve 3-SAT in polynomial time. Moreover, the teacher has given some advice that Shapur has to follow. Here's what the teacher said:
- As I expect you know, the strings I gave to my students (including you) contained only lowercase and uppercase Persian Mikhi-Script letters. These letters are too much like Latin letters, so to make your task much harder I converted all the initial strings and all of the students' answers to Latin.
- As latin alphabet has much less characters than Mikhi-Script, I added three odd-looking characters to the answers, these include "-", ";" and "_". These characters are my own invention of course! And I call them Signs.
- The length of all initial strings was less than or equal to 100 and the lengths of my students' answers are less than or equal to 600
- My son, not all students are genius as you are. It is quite possible that they make minor mistakes changing case of some characters. For example they may write ALiReZaAmIR instead of AlirezaAmir. Don't be picky and ignore these mistakes.
- Those signs which I previously talked to you about are not important. You can ignore them, since many students are in the mood for adding extra signs or forgetting about a sign. So something like Iran;;-- is the same as --;IRAN
- You should indicate for any of my students if his answer was right or wrong. Do this by writing "WA" for Wrong answer or "ACC" for a correct answer.
- I should remind you that none of the strings (initial strings or answers) are empty.
- Finally, do these as soon as possible. You have less than 2 hours to complete this.
在数字比较竞赛之后,沙普尔的老师发现他确实是一位真正的天才,甚至使用超级计算机也没有人能比他计算得更快!
竞赛前几天,老师进行了一次看起来非常简单的考试,他的 n 名学生都参加了这次考试。老师给了他们 3 个字符串,并要求他们将这三个字符串连接起来。所谓字符串连接,是指以任意顺序将它们首尾相接。例如,将 Alireza 和 Amir 连接,根据连接顺序不同,可得到 AlirezaAmir 或 AmirAlireza。
不幸的是,老师忘记事先规定字符串的连接顺序,因此每位学生都按照自己喜好的顺序进行了连接。
现在,老师知道沙普尔是一位计算速度极快的天才少年,于是请他来批改学生们的答卷。
但沙普尔并不擅长这种耗时的任务。他更希望尽快完成这项工作,以便腾出时间去用多项式时间求解 3-SAT 问题。此外,老师还给出了一些沙普尔必须遵守的提示。以下是老师的话:
- 正如你所知,我发给学生(包括你)的原始字符串(含大小写)仅由波斯语 Mikhi-Script 字母组成。这些字母与拉丁字母极为相似;为使你的任务更加困难,我已将所有初始字符串以及所有学生的答案全部转换成了拉丁字母。
- 由于拉丁字母表的字符数量远少于 Mikhi-Script 字符集,我在答案中额外添加了三个怪异的字符:
\-、;和`_`。当然,这些字符完全是我自己的发明!我称它们为“符号”(Signs)。 - 所有初始字符串的长度均不超过 100,而学生答案的长度均不超过 600。
- 我的孩子,不是所有学生都像你一样是天才。他们很可能在个别字符的大小写上犯些小错误。例如,他们可能将
AlirezaAmir错写成ALiReZaAmIR。请不要过于苛刻,忽略这类大小写错误。 - 我之前提到的那些“符号”并不重要。你可以忽略它们,因为许多学生容易多加符号或遗漏符号。因此,类似
Iran;;--的答案与\-;IRAN` 是等价的。 - 你需要判断每位学生的答案是否正确,并在对应位置输出
"WA"(错误答案)或"ACC"(正确答案)。 - 我要提醒你:所有字符串(包括初始字符串和学生答案)均非空。
- 最后,请尽快完成此项任务。你只有不到 2 小时的时间来完成它。
输入格式
The first three lines contain a string each. These are the initial strings. They consists only of lowercase and uppercase Latin letters and signs ("-", ";" and "_"). All the initial strings have length from 1 to 100, inclusively.
In the fourth line there is a single integer n (0 ≤ n ≤ 1000), the number of students.
Next n lines contain a student's answer each. It is guaranteed that the answer meets what the teacher said. Each answer iconsists only of lowercase and uppercase Latin letters and signs ("-", ";" and "_"). Length is from 1 to 600, inclusively.
前三行每行包含一个字符串,这些是初始字符串。它们仅由小写和大写拉丁字母以及符号(“-”、“;”和“_”)组成。所有初始字符串的长度均为 1 到 100(含端点)。
第四行是一个整数 $ n ( 0 \leq n \leq 1000 $),表示学生的数量。
接下来的 $ n $ 行每行包含一名学生的答案。题目保证每个答案均满足老师的要求。每个答案仅由小写和大写拉丁字母以及符号(“-”、“;”和“_”)组成,长度为 1 到 600(含端点)。
输出格式
For each student write in a different line. Print "WA" if his answer is wrong or "ACC" if his answer is OK.
为每位学生单独输出一行。若其答案错误,输出 “WA”;若其答案正确,输出 “ACC”。
输入输出样例
输入#1
Iran_ Persian; W_o;n;d;e;r;f;u;l; 7 WonderfulPersianIran wonderful_PersIAN_IRAN;;_ WONDERFUL___IRAN__PERSIAN__;; Ira__Persiann__Wonderful Wonder;;fulPersian___;I;r;a;n; __________IranPersianWonderful__________ PersianIran_is_Wonderful
输出#1
ACC ACC ACC WA ACC ACC WA
输入#2
Shapur;; is___ a_genius 3 Shapur__a_is___geniUs is___shapur___a__Genius; Shapur;;is;;a;;geni;;us;;
输出#2
WA ACC ACC
输入解题思路,AI测评打分。不知道怎么写?