AlexandruT

[pbInfo] nrlipsa

Oct 28th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3.  
  4. ifstream fin("nrlipsa.in");
  5. ofstream fout("nrlipsa.out");
  6.  
  7. int frecv[1005], sol[2];
  8.  
  9. int main()
  10. {
  11.     int n;
  12.     while(fin >> n) if(n < 1000) frecv[n]++;
  13.     for(int i = 999, j = 0; i > 99 && j < 2; i--)
  14.         if(!frecv[i]) sol[j++] = i;
  15.     if(!sol[0]|| !sol[1]) fout << "NU";
  16.     else fout << sol[0] << " " << sol[1];
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment