Advertisement
skb50bd

UVa 12210 A Match Making Problem

Aug 28th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int B, S, AB[10000], AS;
  6.     int cs = 0, min;
  7.     while(true) {
  8.         cin >> B >> S;
  9.         if(B == 0 && S == 0) break;
  10.         for(int i = 0; i < B; i++)
  11.             cin >> AB[i];
  12.         for(int i = 0; i < S; i++)
  13.             cin >> AS;
  14.         if(B <= S) cout << "Case " << ++cs << ": " << 0 << endl;
  15.         else {
  16.             min = AB[0];
  17.             for(int i = 0; i < B; i++)
  18.                 min = (min > AB[i]) ? AB[i] : min;
  19.             cout << "Case " << ++cs << ": " << B - S << " " << min << endl;
  20.         }
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement