fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define ll long long
  5. #define pb push_back
  6. #define all(x) x.begin(),x.end()
  7. #define FastIO ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
  8.  
  9. const ll N= 1e5+5;
  10. ll cnt[N],ans;
  11.  
  12. int main(){
  13. FastIO;
  14.  
  15. int Test=1;
  16. //cin>>Test;
  17. while(Test--){
  18. ll n; cin>>n;
  19. for(ll i=0;i<n;i++){
  20. ll a; cin>>a;
  21. cnt[a]++;
  22. ans=max(ans,cnt[a]);
  23. }
  24. ans=max(ans,(n+1)/2);
  25.  
  26. cout<<ans<<endl;
  27.  
  28.  
  29. }
  30. return 0;
  31. }
  32. /*
  33.  
  34. */
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include<bits/stdc++.h>
        ^
Main.java:4: error: illegal character: '#'
#define ll long long
^
Main.java:4: error: class, interface, or enum expected
#define ll long long
        ^
Main.java:5: error: illegal character: '#'
#define pb push_back
^
Main.java:6: error: illegal character: '#'
#define all(x) x.begin(),x.end()
^
Main.java:7: error: illegal character: '#'
#define FastIO ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
^
Main.java:7: error: class, interface, or enum expected
#define FastIO ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
                                       ^
Main.java:7: error: class, interface, or enum expected
#define FastIO ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
                                                   ^
Main.java:9: error: class, interface, or enum expected
const ll N= 1e5+5;
^
Main.java:10: error: class, interface, or enum expected
ll cnt[N],ans;
^
Main.java:12: error: class, interface, or enum expected
int main(){
^
Main.java:15: error: class, interface, or enum expected
   int Test=1;
   ^
Main.java:17: error: class, interface, or enum expected
   while(Test--){
   ^
Main.java:18: error: class, interface, or enum expected
       ll n; cin>>n;
             ^
Main.java:19: error: class, interface, or enum expected
       for(ll i=0;i<n;i++){
       ^
Main.java:19: error: class, interface, or enum expected
       for(ll i=0;i<n;i++){
                  ^
Main.java:19: error: class, interface, or enum expected
       for(ll i=0;i<n;i++){
                      ^
Main.java:20: error: class, interface, or enum expected
        ll a; cin>>a;
              ^
Main.java:21: error: class, interface, or enum expected
        cnt[a]++;
        ^
Main.java:22: error: class, interface, or enum expected
        ans=max(ans,cnt[a]);
        ^
Main.java:23: error: class, interface, or enum expected
       }
       ^
Main.java:26: error: class, interface, or enum expected
       cout<<ans<<endl;
       ^
Main.java:29: error: class, interface, or enum expected
   }
   ^
Main.java:31: error: class, interface, or enum expected
}
^
25 errors
stdout
Standard output is empty