SHARE
TWEET

Untitled

a guest Feb 19th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. using namespace std;
  3.  
  4. ifstream fin("datapal.in");
  5. ofstream fout("datapal.out");
  6. int n,i,j,ok,st,dr,maxs,nr,sec;
  7. char d[9],f[100];
  8. int main()
  9. {
  10.     fin>>n;
  11.     for(i=1; i<=n; i++)
  12.     {
  13.         for(j=0; j<8; j++)fin>>d[j];
  14.         ok=1;
  15.         st=0;
  16.         dr=7;
  17.         while(st<dr&&ok==1)
  18.             if(d[st]!=d[dr])ok=0;
  19.             else
  20.             {
  21.                 st++;
  22.                 dr--;
  23.             }
  24.         if(ok==1)
  25.         {
  26.             nr++;
  27.             sec=(d[4]-'0')*10+d[5]-'0';
  28.             f[sec]++;
  29.             if(f[sec]>maxs)maxs=f[sec];
  30.         }
  31.     }
  32.         fout<<nr<<'\n';
  33.        
  34.         for(i=0; i<=99; i++)if(f[i]==maxs) fout<<i+1<<' ';
  35.         return 0;
  36.     }
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
 
Top