#include<cstdio>#include<iostream>
using namespace std;int n, m;int f[1005], d[1005];intmain(){
cin >> n >> m;int x, y;while(m--){
cin >> x >> y;
f[y]= x;
d[x]++;}int maxx =0;for(int i =0; i <=1000; i++){
if(f[i]==0&& d[i]>0) cout << i << endl;if(d[i]> d[maxx]) maxx = i;}
cout << maxx << endl;for(int i =0; i <=1000; i ++){
if(f[i]== maxx) cout << i <<' ';}return0;}
1368 对称二叉树(tree_c)
#include<cstdio>#include<iostream>
using namespace std;intmain(){
string s;
cin >> s;if(s.size()%2==0){
cout <<"No";return0;}for(int i =1; i < s.size(); i = i +2){
if(s[i]=='#'&& s[i+1]!='#'){
cout <<"No";return0;}if(s[i]!='#'&& s[i+1]=='#'){
cout <<"No";return0;}}
cout <<"Yes";return0;}
1363 小球(drop)
#include<iostream>
using namespace std;constint N =1e7;int a[N], d, x;intmain(){
cin >> d >> x;int t;for(int i =1; i <= x; i ++){
t =1;for(int j =1; j < d; j ++){
if(!a[t]){
a[t]=!a[t];
t =2*t;}else{
a[t]=!a[t];
t =2*t +1;}}}
cout << t;return0;}
1367 查找二叉树(tree_a)
#include<cstdio>#include<iostream>
using namespace std;int n, x, cnt;struct node{
int val, l, r;}a[105];voidf(int n){
if(n ==0)return;f(a[n].l);
cnt ++;