Advertisement
a53

fmi_orase2

a53
Dec 26th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <fstream>
  2. #define N 101
  3. using namespace std;
  4. int F[N];
  5.  
  6. int main ()
  7. {
  8. int m,x,orase=0;
  9. ifstream f("fmi_orase2.in");
  10. f>>m;
  11. for(int i=1;i<=m;++i)
  12. {
  13. f>>x;
  14. if(x>=m)
  15. ++F[m];
  16. else
  17. ++F[x];
  18. }
  19. f.close();
  20. ofstream g("fmi_orase2.out");
  21. for(int i=m;i;--i)
  22. {
  23. orase=orase+F[i] ;
  24. if(orase>=i)
  25. {
  26. g<<i;
  27. g.close();
  28. return 0;
  29. }
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement