Language: Java

#include <bits/stdc++.h>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)

int N;
int S, A, C;
int const M = 256;
vector<int> I;
int R[M];

int calcR(int i) {
  if(i==0) { return R[0] = S; }
  return R[i] = (A*calcR(i-1)+C) % M;
}

inline int O(int i) { return (I[i]+R[i+1]) % M; }
int numofx[M];
inline double H() {
  double entropy = 0.;
  rep(i, M) {
    if(numofx[i]) {
      double e = (double)numofx[i]/N;
      entropy -= e * log(e);
    }
  }
  return entropy;
} 

int main() {
  
  typedef pair<int, int> Pii;
  typedef pair<int, Pii> Piii;
  while(cin >> N && N) {
    I.clear(); I.resize(N);
    rep(i, N) { cin >> I[i]; }
    
    double entropy = 1e60;
    Piii ans = Piii(1<<29, Pii(1<<29, 1<<29));
    for(S=0; S<=15; S++)
      for(A=0; A<=15; A++)
        for(C=0; C<=15; C++) {
          calcR(N);
          rep(i, M) numofx[i] = 0;
          rep(i, N) numofx[O(i)] ++;
          double r = H();
          if(entropy > r) {
            entropy = r;
            ans = Piii(S, Pii(A, C));
          }
          /*
          else if(entropy == r) {
            Piii a = Piii(S, Pii(A, C));
            ans = min(ans, a);
          }
          */
        }
    cout << ans.first << " "
         << ans.second.first << " "
         << ans.second.second << endl;
  }
  
  return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:5: error: illegal character: '#'
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
^
Main.java:5: error: class, interface, enum, or record expected
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
        ^
Main.java:5: error: class, interface, enum, or record expected
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
                               ^
Main.java:5: error: class, interface, enum, or record expected
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
                                        ^
Main.java:6: error: illegal character: '#'
#define rep(i,n) REP(i,0,n)
^
Main.java:9: error: class, interface, enum, or record expected
int S, A, C;
^
Main.java:10: error: class, interface, enum, or record expected
int const M = 256;
^
Main.java:11: error: unnamed classes are a preview feature and are disabled by default.
vector<int> I;
^
  (use --enable-preview to enable unnamed classes)
Main.java:12: error: class, interface, enum, or record expected
int R[M];
^
Main.java:19: error: class, interface, enum, or record expected
inline int O(int i) { return (I[i]+R[i+1]) % M; }
^
Main.java:19: error: class, interface, enum, or record expected
inline int O(int i) { return (I[i]+R[i+1]) % M; }
                                                ^
Main.java:21: error: class, interface, enum, or record expected
inline double H() {
^
Main.java:23: error: class, interface, enum, or record expected
  rep(i, M) {
  ^
Main.java:26: error: class, interface, enum, or record expected
      entropy -= e * log(e);
      ^
Main.java:27: error: class, interface, enum, or record expected
    }
    ^
Main.java:30: error: class, interface, enum, or record expected
} 
^
Main.java:35: error: class, interface, enum, or record expected
  typedef pair<int, Pii> Piii;
  ^
Main.java:36: error: class, interface, enum, or record expected
  while(cin >> N && N) {
  ^
Main.java:37: error: class, interface, enum, or record expected
    I.clear(); I.resize(N);
               ^
Main.java:38: error: class, interface, enum, or record expected
    rep(i, N) { cin >> I[i]; }
    ^
Main.java:38: error: class, interface, enum, or record expected
    rep(i, N) { cin >> I[i]; }
                             ^
Main.java:42: error: class, interface, enum, or record expected
    for(S=0; S<=15; S++)
    ^
Main.java:42: error: class, interface, enum, or record expected
    for(S=0; S<=15; S++)
             ^
Main.java:42: error: class, interface, enum, or record expected
    for(S=0; S<=15; S++)
                    ^
Main.java:43: error: class, interface, enum, or record expected
      for(A=0; A<=15; A++)
               ^
Main.java:43: error: class, interface, enum, or record expected
      for(A=0; A<=15; A++)
                      ^
Main.java:44: error: class, interface, enum, or record expected
        for(C=0; C<=15; C++) {
                 ^
Main.java:44: error: class, interface, enum, or record expected
        for(C=0; C<=15; C++) {
                        ^
Main.java:46: error: class, interface, enum, or record expected
          rep(i, M) numofx[i] = 0;
          ^
Main.java:47: error: class, interface, enum, or record expected
          rep(i, N) numofx[O(i)] ++;
          ^
Main.java:49: error: class, interface, enum, or record expected
          if(entropy > r) {
          ^
Main.java:51: error: class, interface, enum, or record expected
            ans = Piii(S, Pii(A, C));
            ^
Main.java:52: error: class, interface, enum, or record expected
          }
          ^
Main.java:63: error: class, interface, enum, or record expected
  }
  ^
Main.java:66: error: class, interface, enum, or record expected
}
^
37 errors