Fzu 2034-password Table (analog)

Source: Internet
Author: User

Problem 2034 Password tableaccept:424 submit:816
Time limit:1000 mSec Memory limit:32768 KB problem Description

Do you know password table? A password table is used to protect the security of the online account. When a-user needs to login-his/her online account or pay-for-money, he/she-need to fill in the password according t o His/her own password table. For example, if one user have the following table and the online system requires him/her to input the password of "a4b7d1", He/she may input "577000".

Input

The first line of the input contains an integer T (t≤100), indicating the number of the test cases. The first line of all case contains three numbers n (5≤n≤9), M (5≤m≤9) and Q (1≤q≤100) representing the length and width of The password table, and the total number of queries (look at the password table above, it length is 8 and it width is 5) . Each of the following n lines contains m numbers, representing the given password table.

Then, each of the following Q lines represents a query with the format of "L1d1l2d2l3d3" (L1, L2 and L3 is letters. D1, D2 and D3 is digits), just like the example in paragraph one.

Output

For each test case, print a line containing the test case number (beginning with 1). For each query in the one test case, please output its corresponding password in one line.

Sample Input18 5 294 62 80 00 2479 11 07 80 0332 66 12 89 4857 82 36 69 3254 66 91 54 9312 14 37 92 8352 70 33 89 9559 91 69a4b7d1e5c3b2 Sample outputcase 1:577000931211 Source2011 National College Program Design Invitational (Fuzhou) test instructions: the title, give an array of n*m, and then give the E-line CAs, The number of rows is numbered from 1 to N, and the number of columns is from a to. Give you a string to find the data in the corresponding table.

A three-dimensional array of water and water simulation just a little bit better.

#include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include < iostream> #include <sstream> #include <algorithm> #include <set> #include <queue> #include <stack> #include <map>using namespace std;typedef long long ll;const int inf=0x3f3f3f3f;const double pi= ACOs ( -1.0); Char A[10][10][1010];int main () {    int t,n,m,q,i,j;    int icase;    Char str[110];    scanf ("%d", &t);    for (icase=1;icase<=t;icase++) {        scanf ("%d%d%d", &n,&m,&q);        for (i=1;i<=n;i++)            for (j=0;j<m;j++)            scanf ("%s", &a[i][j]);        printf ("Case%d:\n", icase);        while (q--) {            scanf ("%s", str);            int Len=strlen (str);            for (i=0;i<len;i+=2) {                printf ("%s", a[str[i+1]-' 0 '][str[i]-' a ');            }            Puts ("");        }        }    return 0;}


Fzu 2034-password Table (analog)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.