#include<bits/stdc++.h>usingnamespace std;const string aim ="(zhangsheng)";intmain(){
cin.tie(nullptr)->sync_with_stdio(false);int n;
cin >> n;
cin.ignore(1,'\n');int cnt =0;for(string s;getline(cin, s,'\n');){constint m = s.size();for(int i =0; i < m;++i){if(s[i]=='#'){goto out;}if(s.substr(i, aim.size())== aim){++cnt;}}}
out:;
cout << cnt <<' '<<(cnt >= n ?"True":"False");return0;}
2
#include<bits/stdc++.h>usingnamespace std;intmain(){
cin.tie(nullptr)->sync_with_stdio(false);int a, b;
cin >> a >> b;int ansm =0, ansn =0;for(int m = a; m <= b;++m){for(int n = a; n <= b;++n){if((n * n - m * n - m * m)*(n * n - m * n - m * m)==1&& \
ansm * ansm + ansn * ansn < m * m + n * n){
ansm = m, ansn = n;}}}int res = ansm * ansm + ansn * ansn;printf("max( %d^2 + %d^2 ) = %d\n", ansm, ansn, res);return0;}
3
#include<bits/stdc++.h>usingnamespace std;intmain(){// cin.tie(nullptr)->sync_with_stdio(false);int n;
cin >> n;
set<int> has;for(int i =0; i < n;++i){int id, op;
cin >> id >> op;if(!op) has.erase(id);else has.insert(id);}
vector<int> res;for(int id : has){
res.push_back(id);}constint m = res.size();for(int i =0; i < m;++i){
cout << right <<setw(4)<<setfill('0') \
<< res[i]<<" \n"[i == m -1];}if(m ==1){
cout <<"Da Ben Zhong is found!\n";}else{printf("There are %d suspects.\n", m);}return0;}
4
#include<bits/stdc++.h>usingnamespace std;intmain(){
cin.tie(nullptr)->sync_with_stdio(false);int a, b;
cin >> a >> b;
string sa =to_string(a), sb =to_string(b);for(int i =0; i <(int)sa.size();++i){
size_t pb = sb.find(sa[i]);if(pb == string::npos)continue;
sa[i]=' ', sb[pb]=' ';}
string ta, tb;for(char c : sa){if(c ==' ')continue;
ta += c;}for(char c : sb){if(c ==' ')continue;
tb += c;}int c = ta.empty()?0:stoi(ta);int d = tb.empty()?0:stoi(tb);int lv = a * d, rv = b * c;printf("%d/%d %s %d/%d\n", a, b,(lv != rv ||(c ==0&& d ==0)?"!=":"="), c, d);return0;}
5
#include<bits/stdc++.h>usingnamespace std;intmain(){
cin.tie(nullptr)->sync_with_stdio(false);int n;
cin >> n;
queue<int> Q;for(int i =0; i < n;++i){int x;
cin >> x;
Q.push(x);}int cur =0;
vector<int>cnt(n +1);for(int i =1; i <= n;++i){while(true){++cur;int x = Q.front(); Q.pop();if(x != i) Q.push(x);else{
cnt[x]= cur;break;}}}int time =*max_element(cnt.begin()+1, cnt.end());int sum =accumulate(cnt.begin()+1, cnt.end(),0);printf("%d %.1lf\n", time,1.0* sum / n);return0;}