Advertisement
vitormartinotti

OBI2017_f1p2_botas

Oct 1st, 2023 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main () {
  6.     //Pair
  7.     vector<pair<int, int>> botas;
  8.     botas.resize(61);
  9.  
  10.     int n; scanf("%d", &n);
  11.  
  12.     for (int i = 1; i <=n; i++){
  13.         int tam;
  14.         char lado;
  15.         scanf("%d %c", &tam, &lado);
  16.         if(lado == 'E'){
  17.             botas[tam].first++;
  18.         }
  19.         else{
  20.             botas[tam].second++;
  21.         }
  22.     }
  23.  
  24.     int pares = 0;
  25.     for (int i = 30; i <= 60; i++){
  26.         pares += min(botas[i].first, botas[i].second);
  27.     }
  28.  
  29.     printf("%d", pares);
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement