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…
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…
1095 解码PAT准考证/1153 Decode Registration Card of PAT(25 分) PAT 准考证号由 4 部分组成: 第 1 位是级别,即 T 代表顶级:A 代表甲级:B 代表乙级: 第 2~4 位是考场编号,范围从 101 到 999: 第 5~10 位是考试日期,格式为年.月.日顺次各占 2 位: 最后 11~13 位是考生编号,范围从 000 到 999. 现给定一系列考生的准考证号和他们的成绩,请你按照要求输出各种统计信息. 输入格式: 输入首先在一行中给…
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…
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…
Source: PAT A1153 Decode Registration Card of PAT (25 分) Description: 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 ar…
Decode Registration Card of PAT PAT-1153 这里需要注意题目的规模,并不需要一开始就存储好所有的满足题意的信息 这里必须使用unordered_map否则会超时 vector的使用需要注意,只有一开始赋予了容量才能读取. 不需要使用set也可以 #include<iostream> #include<cstring> #include<string> #include<algorithm> #include<cst…
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…
题目:1040 有几个PAT (25 分) 思路: 是个规律题,只要找到规律就有思路,那代码基本就有了,就是怎么实现比较好和是否简洁的问题. 很明显:A是分水岭,A前面有多少个P和A后面有多少个T知道的话,那有几个PAT就是P的个数*T的个数的问题了. 总个数为前面所有A所在位置能构成的PAT数+现在A所在位置能构成的PAT数. 详情代码. 代码: #include <cstdio> #include <cstring> #include <iostream> #inc…
字符串 APPAPT 中包含了两个单词 PAT,其中第一个 PAT 是第 2 位(P),第 4 位(A),第 6 位(T):第二个 PAT 是第 3 位(P),第 4 位(A),第 6 位(T). 现给定字符串,问一共可以形成多少个 PAT? 输入格式: 输入只有一行,包含一个字符串,长度不超过1,只包含 P.A.T 三种字母. 输出格式: 在一行中输出给定字符串中包含多少个 PAT.由于结果可能比较大,只输出对 1000000007 取余数的结果. 输入样例: APPAPT 输出样例: 2 #…