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<algorithm>
using namespace std;
static const int MAX_N = 1000;

int N;
pair<int, int> p[MAX_N];
int res[MAX_N];

int main(){
	cin >> N;
	for(int i = 0; i < N; i++){
		p[i].first = 0;
		p[i].second = i;
	}
	for(int i = 0; i < N * (N - 1) / 2; i++){
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		a--; b--;
		if(c > d){
			p[a].first += 3;
		}else if(c < d){
			p[b].first += 3;
		}else{
			p[a].first += 1;
			p[b].first += 1;
		}
	}
	sort(p, p + N);
	reverse(p, p + N);
	for(int i = 0; i < N; i++){
		res[p[i].second] = i + 1;
		int t = i;
		while(p[t + 1].first == p[t].first){
			t++;
			res[p[t].second] = i + 1;
		}
		i = t;
	}
	for(int i = 0; i < N; i++){
		cout << res[i] << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

const int MAXN = 101;
int res[MAXN];
int po[MAXN];
bool used[MAXN];
typedef pair<int, int> pp;

int main()
{
    int n, game;
    cin >> n; game = n * (n - 1) /2;
    vector<pp> p;

    int a, b, c, d;
    REP(game)
    {
        cin >> a >> b >> c >> d;
        a--; b--;
        if(c > d){ po[a] += 3; continue;}
        if(c < d){ po[b] += 3; continue;}
        po[a]++; po[b]++;
    }
    REP(n) p.push_back(pp(po[i], i));
    sort(all(p), greater<pp>() );
    
    int junni = 1;
    res[p[0].second] = junni;
    for(int i = 1;i <n;i++)
    {
        if(p[i].first == p[i-1].first )res[p[i].second] = junni;
        else{ junni = i + 1; res[p[i].second] = junni;}
    }
    REP(n) cout << res[i] << endl;
    return 0;
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
int p[200];
int main(){
	int a;
	scanf("%d",&a);
	for(int i=0;i<(a*(a-1)/2);i++){
		int b,c,d,e;
		scanf("%d%d%d%d",&b,&c,&d,&e);
		b--;c--;
		if(d>e)p[b]+=3;
		else if(e>d)p[c]+=3;
		else {p[b]++;p[c]++;}
	}
	for(int i=0;i<a;i++){
		int num=1;
		for(int j=0;j<a;j++){
			if(p[j]>p[i])num++;
		}
		printf("%d\n",num);
	}
}

C++: #include<stdio.h>
int main(void)
{
	int i,j,n,n1;
	int a,b,c,d;
	int cnt[100];
	int sum[100];
	
	scanf("%d",&n);
	n1=n*(n-1)/2;
	for (i=0; i<n; i++) {
		sum[i]=0;
		cnt[i]=1;
	}
	for(i=0;i<n1;i++){
		scanf("%d %d %d %d",&a,&b,&c,&d);
		if(c>d){
			sum[a-1]+=3;
		}
		else if(c<d){
			sum[b-1]+=3;
		}
		else{
			sum[a-1]+=1;
			sum[b-1]+=1;
		}
	}
	for (i=0; i<n;i++) {    
		for (j=0;j<n;j++){
			if(sum[i]<sum[j]){
				cnt[i]++;
				
			}
		}
		printf("%d\n",cnt[i]);
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <string>
#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

int main(void)
{
    int n, a[100],rank[100], b[100], c[100],d[100],k[100],win[100],lose[100],p[100],pp[100];
    cin >> n;

    for (int i = 0; i < n * (n - 1) / 2; i++)
    {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        if (c[i] < d[i])
        {
            win[i] = b[i];
            lose[i] = a[i];
            p[i] = 0;
            pp[i] = 0;
        }
        else if (c[i] > d[i])
        {
            win[i] = a[i];
            lose[i] = b[i];
            p[i] = 0;
            pp[i] = 0;
        }
        else if (c[i] == d[i])
        {
            win[i] = 0;
            lose[i] = 0;
            p[i] = a[i];
            pp[i] = b[i];
        }
    }

    for (int i = 0; i < n * (n - 1) / 2; i++)
    {
        for (int j = 1; j < n + 1; j++)
        {
            if (win[i] == j)
            {
                k[j] += 3;
            }
            if (lose[i] == j)
            {
                k[j] += 0;
            }
            if (p[i] == j || pp[i] == j)
            {
                k[j] += 1;
            }            

        }
    }

    for (int j = 1; j < n + 1; j++)
    {
        rank[j] = 1;
        for (int l = 1; l < n + 1; l++)
        {
            if (k[j] <= k[l])
            {
                rank[j] += 1;
            }
        }
    }
    for (int j = 1; j < n + 1; j++)
    {
        cout << rank[j] << endl;
    }
return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>

using namespace std;

int main() {

  int n;
  cin >> n;
  vector<int> costs( n );
  for ( int i = 0; i < n; i++ ) {
    costs[i] = 0;
  }
  int lim = n * (n - 1) / 2;
  for ( int i = 0; i < lim; i++ ) {
    int a, b, p, q;
    cin >> a >> b >> p >> q;
    if (p < q) {
      costs[b - 1] += 3;
    } else if (p > q) {
      costs[a - 1] += 3;
    } else {
      costs[a - 1] += 1;
      costs[b - 1] += 1;
    }
  }
  for ( const int cost : costs ) {
    int count = 1;
    for ( const int val : costs ) {
      if ( val > cost ) count++;
    }
    cout << count << endl; 
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)

int main(){
  int N; cin>>N;
  vector<int> sc(N,0);
  rep(i,N*(N-1)/2){
    int a,b,c,d; cin>>a>>b>>c>>d; 
    if(c>d) sc[a-1]+=3;
    else if(c<d) sc[b-1]+=3;
    else{ ++sc[a-1]; ++sc[b-1]; }
  }
  rep(i,N){
    int x=1;
    rep(j,N) if(sc[i]<sc[j]) ++x;
    cout<<x<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int A[n + 1] = {};
    for(int i = 0; i < n * (n - 1) / 2; i++)
    {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        if(c > d) A[a] += 3;
        else if(c < d) A[b] += 3;
        else
        {
            A[a]++;
            A[b]++;
        }
    }
    for(int i = 1; i <= n; i++)
    {
        int r = 1;
        for(int j = 1; j <= n; j++)
        {
            if(A[i] < A[j]) r++;
        }
        cout << r << endl;
    }
    return 0;
}