Məsələlər
Tillər cədvəlinə görə təpələrin yarımdərəcəsi
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m, x, y, res=0, res1=0;
cin>>n>>m;
int g[n+1][n+1];
memset(g, 0, sizeof(g));
while(m--){
cin>>x>>y;
g[x][y] = 1;
}
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
if(g[i][j] == 1){
res++;
}
if(g[j][i] == 1){
res1++;
}
}
cout<<res1<<" "<<res<<endl;
res1=0;
res=0;
}
return 0;
}