Go: package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
	"strings"
	"sort"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextLineInt() []int {
	arr := strings.Split(nextLine(), " ")
	var ret []int
	for _, v := range arr {
		x, _ := strconv.Atoi(v)
		ret = append(ret, x)
	}
	return ret
}

type Pair struct {
	First int
	Second int
}

type Pairs []Pair

func (s Pairs) Len() int {
	return len(s)
}

func (s Pairs) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}

func (s Pairs) Less(i, j int) bool {
	return s[i].First > s[j].First
}

func main() {
	var n int
	arr := nextLineInt()
	n = arr[0]
	result := []Pair{}
	for i := 0; i < n; i++ {
		result = append(result, Pair{0, i})
	}
	for i := 0; i < n * (n - 1) / 2; i++ {
		arr := nextLineInt()
		A := arr[0]
		B := arr[1]
		C := arr[2]
		D := arr[3]
		if C > D {
			result[A-1].First += 3
		} else if C < D {
			result[B-1].First += 3
		} else {
			result[A-1].First++
			result[B-1].First++
		}
	}
	sort.Sort(Pairs(result))
	var ans [111]int
	point := 1000000000
	top := 0
	for i, r := range result {
		// 前の人よりポイントが低い
		if point > r.First {
			top = i + 1
			point = r.First
		}
		ans[r.Second] = top
	}
	for i := 0; i < n; i++ {
		fmt.Println(ans[i])
	}
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(ll i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(ll i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)
 
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007






int main(){
	int n;
	cin >> n;
	int a,b,c,d;
	vector<pii> v(n,pii(0,0));
	rep(i,n) v[i].se = i;
	
	rep(i,n*(n-1)/2){
		cin>>a>>b>>c>>d;
		a--; b--;
		if(c > d) v[a].fi -= 3;
		else if ( c < d) v[b].fi -= 3;
		else{
			v[a].fi--; v[b].fi--;
		}
	}
	
	sort(all(v));
	vi ans(n,0);
	int tmp = 0;
	for(int i = 0; i < n; i++){
		ans[v[i].se] = i;
		if(i != 0 && tmp == v[i].fi) ans[v[i].se] = ans[v[i-1].se];
		tmp = v[i].fi;
	}
	for(int i = 0; i < n; i++){
		cout<<ans[i]+1<<endl;
	}
}

C++: #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;

	vector<int> points(n, 0);

	for(int i = 0; i < n * (n - 1) / 2; ++i) {
		int a, b, score_a, score_b;
		cin >> a >> b >> score_a >> score_b;
		if(score_a > score_b) {
			points[a - 1] += 3;
		}
		else if(score_a == score_b) {
			++points[a - 1];
			++points[b - 1];
		}
		else {
			points[b - 1] += 3;
		}
	}

	vector<int> tmp(points);
	sort(tmp.rbegin(), tmp.rend());

	for(int i = 0; i < n; ++i) {
		for(int j = 0; j < n; ++j) {
			if(points[i] == tmp[j]) {
				cout << j + 1 << endl;
				break;
			}
		}
	}

	return EXIT_SUCCESS;
}

C++: #include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
int n;
class Team{
public:
  int p,n,rank;
  Team(int _p,int _n,int _rank):p(_p),n(_n),rank(_rank){
  }
  bool operator < (const Team &o)const{
    return p > o.p;
  }
};
vector<Team> v;
void solve(){

  
}
void show(){
  for(vector<Team>::iterator it=v.begin();it!=v.end();it++){
    cout<<(*it).n<<","<<(*it).p<<endl;
  }
}
int main(){
  cin>>n;
  for(int i=0;i<n;i++){
    v.push_back(Team(0,i,0));
  }
  for(int i=0;i<(n*(n-1))/2;i++){
    int a,b,ap,bp;
    cin>>a>>b>>ap>>bp;
    int aw=0;
    int bw=0;
    if(ap>bp) aw=3;
    
    else if(ap<bp) bw=3;
    else {
      aw=bw=1;
    }
    v[a-1].p+=aw;
    v[b-1].p+=bw;
  }
  sort(v.begin(),v.end());
  //  show();
  int i=0;
  int r[101];
  int point=-1;
  int tmp=0;
  for(vector<Team>::iterator it=v.begin();it!=v.end();it++){
    if(point!=(*it).p){i+=tmp+1;tmp=0;}
    else tmp++;
    point=(*it).p;
    r[(*it).n]=i;
  }
  for(int i=0;i<n;i++){
    cout<<r[i]<<endl;
  }
 
  return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
  int n; cin >> n;
  int team[110] = {};

  for(int i = 0; i < n*(n-1)/2; i++) {
    int a, b, ap, bp; cin >> a >> b >> ap >> bp;
    if(ap > bp) team[a] += 3;
    else if(ap < bp) team[b] += 3;
    else {
      team[a]++;
      team[b]++;
    }
  }

  int cnt = n;
  while(cnt) {
    int m = -1;
    for(int i = 1; i <= n; i++) {
      if(m < team[i]) {
        m = team[i];
      }
    }
    
    int same = 0;
    for(int i = 1; i <= n; i++) {
      if(m == team[i]) {
        team[i] = (n-cnt+1) * -1;
        same++;
      }
    }
    cnt -= same;
  }
  for(int i = 1; i <= n; i++) cout << team[i]*-1 << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int n;
    cin >> n;
    vector<int> v(n, 0);
    for (int i = 0; i < n*(n-1)/2; ++i) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        if(c > d) swap(a, b);
        if(c == d) v[a-1]++, v[b-1]++;
        else v[b-1] += 3;
    }
    vector<int> v2 = v;
    sort(v2.begin(), v2.end(), greater<>());
    for (int i = 0; i < n; ++i) {
        cout << lower_bound(v2.begin(), v2.end(), v[i], greater<>()) - v2.begin() + 1 << "\n";
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

void solve()
{
	int N;
	cin >> N;
	vector<int> sum(N);
	int n = N * (N - 1) / 2;
	for(int i = 0; i < n; ++i)
	{
		int t1, t2;
		cin >> t1 >> t2;
		int p1, p2;
		cin >> p1 >> p2;
		if(p1 > p2)
		{
			sum[t1 - 1] += 3;
		}
		else if(p1 < p2)
		{
			sum[t2 - 1] += 3;
		}
		else
		{
			++sum[t1 - 1];
			++sum[t2 - 1];
		}
	}
	vector<int> ans(N);
	set<int> kind;
	for(int i = 0; i < N; ++i)
	{
		kind.insert(sum[i]);
	}
	int rank = 1;
	set<int>::reverse_iterator rit = kind.rbegin();
	while(rit != kind.rend())
	{
		int count = 0;
		for(int i = 0; i < N; ++i)
		{
			if(*rit == sum[i])
			{
				ans[i] = rank;
				++count;
			}
		}
		rank += count;
		++rit;
	}
	for(int i = 0; i < N; ++i)
	{
		cout << ans[i] << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
using namespace std;

int main(){
  int t[110]={};
  int N;
  cin >> N;
  int a,b,c,d;
  //得点
  for(int i = 0; i < N*(N-1)/2; i++){
    cin >> a >> b >> c >> d;
    if(c > d) t[a-1] += 3;
    else if(c < d) t[b-1] += 3;
    else if(c == d){
      t[a-1]++;
      t[b-1]++;
    }
  }
  //順位
  int p = 0,rank[110]={};
  for(int j = 1; j < N+1; j+=p){
    int max = -1;
    for(int i = 0; i < N; i++){
      if(max < t[i]){
	max = t[i];
      }
    } 
    p = 0;
    for(int i = 0; i < N; i++){
      if(max == t[i]){
	rank[i] = j;
	p++;
	t[i] = -1;
      }
    }
    
  }
  for(int i = 0; i < N; i++){
    cout << rank[i] << endl;
  }
  return 0;
}