Advertisement
tepyotin2

Horn, Grass, Shears

Dec 9th, 2023
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.     ios_base::sync_with_stdio(0), cin.tie(0);
  7.     // freopen("hgs.in", "r", stdin);
  8.     int n;
  9.     cin >> n;
  10.     int a, b;
  11.     int win1 = 0;
  12.     int win2 = 0;
  13.     for(int i=0; i<n; i++){
  14.         cin >> a >> b;
  15.         if(a==1 && b==2){
  16.             win1++;
  17.         }else if(a==2 && b==3){
  18.             win1++;
  19.         }else if(a==3 && b==1){
  20.             win1++;
  21.         }else if(a==1 && b==3){
  22.             win2++;
  23.         }else if(a==3 && b==2){
  24.             win2++;
  25.         }else if(a==2 && b==1){
  26.             win2++;
  27.         }
  28.     }
  29.     cout << max(win1, win2) << '\n';
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement