cd ~/.ssh ssh-keygen -t rsa -b 4096 -C "www.hdvsyu.com"
-t 密钥类型有 dsa、ecdsa、 ed25519、 rsa 等可选
-b 指定密钥长度
-C 备注
1 2 3 4
Generating public/private rsa key pair. Enter file inwhich to save the key (/Users/hdvsyu/.ssh/id_rsa): # 指定密钥的文件名, 默认使用id_rsa Enter passphrase (empty for no passphrase): # 密钥的密码, 一般情况下不加密, 直接输回车 Enter same passphrase again: # 输入密码或者继续回车
A registration card number of PAT consists of 4 parts:
the 1st letter represents the test level, namely, T for the top level, A for advance and B for basic;
the 2nd - 4th digits are the test site number, ranged from 101 to 999;
the 5th - 10th digits give the test date, in the form of yymmdd;
finally the 11th - 13th digits are the testee’s number, ranged from 000 to 999.
Now given a set of registration card numbers and the scores of the card owners, you are supposed to output the various statistics according to the given queries.
Input Specification:
Each input file contains one test case. For each case, the first line gives two positive integers N (≤104) and M (≤100), the numbers of cards and the queries, respectively.
Then N lines follow, each gives a card number and the owner’s score (integer in [0,100]), separated by a space.
After the info of testees, there are M lines, each gives a query in the format Type Term, where
Type being 1 means to output all the testees on a given level, in non-increasing order of their scores. The corresponding Term will be the letter which specifies the level;
Type being 2 means to output the total number of testees together with their total scores in a given site. The corresponding Term will then be the site number;
Type being 3 means to output the total number of testees of every site for a given test date. The corresponding Term will then be the date, given in the same format as in the registration card.
Output Specification:
For each query, first print in a line Case #: input, where # is the index of the query case, starting from 1; and input is a copy of the corresponding input query. Then output as requested:
for a type 1 query, the output format is the same as in input, that is, CardNumber Score. If there is a tie of the scores, output in increasing alphabetical order of their card numbers (uniqueness of the card numbers is guaranteed);
for a type 2 query, output in the format Nt Ns where Nt is the total number of testees and Ns is their total score;
for a type 3 query, output in the format Site Nt where Site is the site number and Nt is the total number of testees at Site. The output must be in non-increasing order of Nt‘s, or in increasing order of site numbers if there is a tie of Nt.
If the result of a query is empty, simply print NA.
In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL consisting of the first 10-digit prime found in consecutive digits of the natural constant e. The person who could find this prime number could go to the next step in Google’s hiring process by visiting this website.
The natural constant e is a well known transcendental number(超越数). The first several digits are: e = 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921… where the 10 digits in bold are the answer to Google’s question.
Now you are asked to solve a more general problem: find the first K-digit prime in consecutive digits of any given L-digit number.
Input Specification:
Each input file contains one test case. Each case first gives in a line two positive integers: L (≤ 1,000) and K (< 10), which are the numbers of digits of the given number and the prime to be found, respectively. Then the L-digit number N is given in the next line.
Output Specification:
For each test case, print in a line the first K-digit prime in consecutive digits of N. If such a number does not exist, output 404 instead. Note: the leading zeroes must also be counted as part of the K digits. For example, to find the 4-digit prime in 200236, 0023 is a solution. However the first digit 2 must not be treated as a solution 0002 since the leading zeroes are not in the original number.
The “Hamilton cycle problem” is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a “Hamiltonian cycle”. In this problem, you are supposed to tell if a given cycle is a Hamiltonian cycle.
Input Specification:
Each input file contains one test case. For each case, the first line contains 2 positive integers N (2< N <= 200), the number of vertices, and M, the number of edges in an undirected graph. Then M lines follow, each describes an edge in the format “Vertex1 Vertex2”, where the vertices are numbered from 1 to N. The next line gives a positive integer K which is the number of queries, followed by K lines of queries, each in the format: n V1 V2 … Vn where n is the number of vertices in the list, and Vi’s are the vertices on a path.
Output Specification:
For each query, print in a line “YES” if the path does form a Hamiltonian cycle, or “NO” if not.
intisConnected(int *v, int n){ int pre = v[0]; for (int i = 1; i < n; i++) { if (graph[pre][v[i]] != 1) { return0; } pre = v[i]; } return1; }
intisHamilt(int *v, int n){ if (v[0] != v[n - 1]) return0; int *times = newint[n]; for (int i = 0; i < n; i++) { times[i] = 0; } for (int i = 0; i < n; i++) { times[v[i]]++; }
for (int i = 1; i < n; i++) { if (i == v[0]) { if (times[i] != 2) { return0; } } else { if (times[i] != 1) { return0; } } } return1; }
intmain(){ int n = 0, m = 0; scanf("%d %d", &n, &m); graph = newint *[n + 1]; for (int i = 0; i <= n; i++) { graph[i] = newint[n + 1]; } for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { graph[i][j] = 0; } } for (int i = 0; i < m; i++) { int a = 0, b = 0; scanf("%d %d", &a, &b); graph[a][b] = graph[b][a] = 1; } int k = 0; scanf("%d", &k); for (int i = 0; i < k; i++) { int kn = 0; scanf("%d", &kn); int *v = newint[kn]; for (int j = 0; j < kn; j++) { scanf("%d", &v[j]); } if (kn == n + 1 && isConnected(v, kn) && isHamilt(v, kn)) { printf("YES\n"); } else { printf("NO\n"); } } return0; }