SHARE
TWEET

29os Δημήτρης Τούλης

a guest Nov 19th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <cstdio>
  2.  
  3. int N,emf[10005],index,s1,s2,s3;
  4.  
  5. int main(){
  6.     freopen("sch.in","r",stdin);
  7.     freopen("sch.out","w",stdout);
  8.     scanf("%d",&N);
  9.     for(int i = 0;i<N;i++){
  10.         int temp;
  11.         scanf("%d",&temp);
  12.         emf[temp]++;
  13.     }
  14.     int mega1 = emf[0];
  15.     index = 0;
  16.     for(int i=1; i<10000; i++){
  17.         if(mega1<emf[i]){
  18.             mega1 = emf[i];
  19.             s1 = i;
  20.         }
  21.         emf[s1] = 0;
  22.     }
  23.        
  24.     int mega2 = emf[0];
  25.     index = 0;
  26.     for(int i=1; i<10000; i++){
  27.         if(mega2<emf[i]){
  28.             mega2 = emf[i];
  29.             s2 = i;
  30.         }
  31.         emf[s2] = 0;   
  32.     }  
  33.     int mega3 = emf[0];
  34.     index = 0;
  35.     for(int i=1; i<10000; i++)
  36.     {
  37.         if(mega3<emf[i]){
  38.             mega3 = emf[i];
  39.             s3 = i;
  40.         }
  41.         emf[s3] = 0;
  42.     }
  43.     printf("%d %d %d",s1,s2,s3);  
  44.     return 0;
  45. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top