알고리즘

[알고리즘] 백준 5523 - 경기 결과 (C++)

blueberrysoda 2024. 11. 6. 23:58

[문제 링크] : https://www.acmicpc.net/problem/5523

#include <iostream>
using namespace std;

int main(){
    int N;
    int a = 0, b = 0, t, s;

    cin >> N;
    for(int i=0; i<N; i++){
        cin >> t >> s;
        if(t < s){
            b++;
        }
        else if(t > s){
            a++; 
        }
    }
    cout << a << " " << b << "\n";
    return 0;
}