#include#include using namespace std; #define x first #define y second map cnt1; vector cnt[100010]; int re[110]; int main() { int n, m; scanf("%d%d", &n,&m); for (int i = 1; i <=n; i++) { int k; scanf("%d", &k); for (int j = 0; j < k; j++) { int x; scanf("%d", &x); cnt[i].push_back(x); } } int p = 1; for (int i = 0; i < m; i++) { int a, b; scanf("%d%d", &a, &b); if (a == 0) { p = cnt[p][b - 1]; } else if (a == 1) { re[b] = p; cout << p; cout << endl; } else { p = re[b]; } } cout< 清点代码库
#include#include using namespace std; #define x first #define y second map , int> cnt; vector >> ans; int main() { int n, m; scanf_s("%d%d", &n, &m); for (int i = 0; i line; for (int j = 0; j < m; j++) { int a; scanf_s("%d", &a); line.push_back(a); } cnt[line]++; } for (auto& p : cnt) { ans.push_back({ -p.second,p.first }); } sort(ans.begin(), ans.end()); cout << ans.size()< 悄悄关注 #include乘法口诀 2 3 10#include using namespace std; #define x first #define y second map cnt; struct node { string name; int num; }a[100010]; bool cmp(node a,node b) { return a.name < b.name; } int main() { int n, m; cin>>n; for (int i = 0; i >ss; cnt[ss]++; } cin>>m; double sum=0; for (int i = 0; i < m; i++) { cin>>a[i].name>>a[i].num; sum += a[i].num; } sum = sum * 1.0 / m; sort(a,a+m,cmp); int fa = 0; for (int i = 0; i < m; i++) { if (a[i].num > sum && !cnt[a[i].name]) { fa = 1; cout << a[i].name; if (i < m - 1) cout << endl; } } if (fa == 0) cout << "Bing Mei You"; } #include#include using namespace std; #define x first #define y second map cnt1; vector cnt[100010]; const int n = 1010; int re[100010]; int main() { string a1, a2;int n; cin >> a1 >> a2 >> n; int k = 2; string str = a1 + a2; int i = 0, j = 1; while(str.size() 包装机 #includeABCDdefg#include using namespace std; #define x first #define y second map cnt1; vector cnt[100010]; int re[100010]; int main() { queue qq[110]; stack ss; char a[1010]; int n, m, ma; cin >> n >> m >> ma; for (int i = 1; i <=n; i++) { char str[10000]; cin >> str; for (int j = 0; j >x,x!=-1) { if (x == 0) { if (ss.size()) { cout << ss.top(); ss.pop(); } } if (x > 0) { if (ss.size() == ma&&qq[x].size()) { cout << ss.top(); ss.pop(); } if (qq[x].size()) { ss.push(qq[x].front()); qq[x].pop(); } } } } #include#include using namespace std; int main() { int n; cin >> n; while (n--) { char str[10000]; cin >> str; int j; for (j = 1; j < strlen(str); j++) { if (str[j] >= 'a' && str[j] <= 'z') { if (str[j - 1] >= 'A' && str[j - 1] <= 'Z'&& str[j] != str[j - 1] - 'A' + 'a') { cout << "N" << endl; break; } if (str[j - 1] >= 'a' && str[j - 1] <= 'z'&& str[j] != str[j - 1] + 1) { cout << "N" << endl; break; } } if (str[j] >= 'A' && str[j] <= 'Z') { if (str[j - 1] >= 'a' && str[j - 1] <= 'z' && str[j] != str[j - 1] - 'a' + 'A') { cout << "N" << endl; break; } if (str[j - 1] >= 'A' && str[j - 1] <= 'Z' && str[j] != str[j - 1] + 1) { cout << "N" << endl; break; } } } if (j >= strlen(str))cout << "Y" << endl; } }



