Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("nrlipsa.in");
- ofstream fout("nrlipsa.out");
- int frecv[1005], sol[2];
- int main()
- {
- int n;
- while(fin >> n) if(n < 1000) frecv[n]++;
- for(int i = 999, j = 0; i > 99 && j < 2; i--)
- if(!frecv[i]) sol[j++] = i;
- if(!sol[0]|| !sol[1]) fout << "NU";
- else fout << sol[0] << " " << sol[1];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment