fork download
  1. #include<bits/stdc++.h>
  2. #include <set>
  3. #include<iomanip>
  4. #include<math.h>
  5. #define ll long long
  6. #define MOD (ll)(1e7+7)
  7. #define all(x) (x).begin(), (x).end(
  8. using namespace std;
  9. int readInt() { int x; return cin >> x, x; }
  10. template<typename T> void maximize(T &res, T val) { if (res < val) res = val; }
  11. template<typename T> void minimize(T &res, T val) { if (res > val) res = val; }
  12. void maximize(int &x, int v) { if (x < v) x = v; }
  13. const int LIM = 1e6;
  14. int fre[256] = {};
  15. bool isLatin(char c) { return 'a' <= c && c <= 'z'; }
  16. inline bool isLowLatin(char c) { return 'a' <= c && c <= 'z'; }
  17. inline bool isDigit(char c) { return '0' <= c && c <= '9'; }
  18. int main()
  19. {
  20. int lim = 5e6;
  21. vector<int> div_sum(lim + 1, 0);
  22. for (int i = 1; i <= lim; ++i)
  23. for (int j = i; j <= lim; j += i)
  24. div_sum[j] += i;
  25.  
  26. vector<bool> check(lim + 1);
  27. for (int i = 0; i <= lim; ++i)
  28. check[i] = (div_sum[i] < i * 2);
  29.  
  30. int res = 0;
  31. for (int n = readInt(); n--; res += check[readInt()]);
  32.  
  33. cout << res;
  34. return 0;
  35. }
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:2: error: illegal character: '#'
#include <set>
^
Main.java:3: error: illegal character: '#'
#include<iomanip>
^
Main.java:4: error: illegal character: '#'
#include<math.h>
^
Main.java:5: error: illegal character: '#'
#define ll long long
^
Main.java:6: error: illegal character: '#'
#define MOD (ll)(1e7+7)
^
Main.java:7: error: illegal character: '#'
#define all(x) (x).begin(), (x).end(
^
Main.java:9: error: class, interface, or enum expected
int readInt() { int x; return cin >> x, x; }
^
Main.java:9: error: class, interface, or enum expected
int readInt() { int x; return cin >> x, x; }
                       ^
Main.java:9: error: class, interface, or enum expected
int readInt() { int x; return cin >> x, x; }
                                           ^
Main.java:10: error: class, interface, or enum expected
template<typename T> void maximize(T &res, T val) { if (res < val) res = val; }
                                                                              ^
Main.java:11: error: class, interface, or enum expected
template<typename T> void minimize(T &res, T val) { if (res > val) res = val; }
                                                                              ^
Main.java:12: error: class, interface, or enum expected
void maximize(int &x, int v) { if (x < v) x = v; }
                                                 ^
Main.java:14: error: class, interface, or enum expected
int fre[256] = {};
^
Main.java:15: error: class, interface, or enum expected
bool isLatin(char c) { return 'a' <= c && c <= 'z'; }
^
Main.java:15: error: class, interface, or enum expected
bool isLatin(char c) { return 'a' <= c && c <= 'z'; }
                                                    ^
Main.java:16: error: class, interface, or enum expected
inline bool isLowLatin(char c) { return 'a' <= c && c <= 'z'; }
                                                              ^
Main.java:17: error: class, interface, or enum expected
inline bool isDigit(char c)    { return '0' <= c && c <= '9'; }
                                                              ^
Main.java:21: error: class, interface, or enum expected
    vector<int> div_sum(lim + 1, 0);
    ^
Main.java:22: error: class, interface, or enum expected
    for (int i = 1; i <= lim; ++i)
    ^
Main.java:22: error: class, interface, or enum expected
    for (int i = 1; i <= lim; ++i)
                    ^
Main.java:22: error: class, interface, or enum expected
    for (int i = 1; i <= lim; ++i)
                              ^
Main.java:23: error: class, interface, or enum expected
        for (int j = i; j <= lim; j += i) 
                        ^
Main.java:23: error: class, interface, or enum expected
        for (int j = i; j <= lim; j += i) 
                                  ^
Main.java:26: error: class, interface, or enum expected
    vector<bool> check(lim + 1);
    ^
Main.java:27: error: class, interface, or enum expected
    for (int i = 0; i <= lim; ++i)
    ^
Main.java:27: error: class, interface, or enum expected
    for (int i = 0; i <= lim; ++i)
                    ^
Main.java:27: error: class, interface, or enum expected
    for (int i = 0; i <= lim; ++i)
                              ^
Main.java:30: error: class, interface, or enum expected
    int res = 0;
    ^
Main.java:31: error: class, interface, or enum expected
    for (int n = readInt(); n--; res += check[readInt()]); 
    ^
Main.java:31: error: class, interface, or enum expected
    for (int n = readInt(); n--; res += check[readInt()]); 
                            ^
Main.java:31: error: class, interface, or enum expected
    for (int n = readInt(); n--; res += check[readInt()]); 
                                 ^
Main.java:33: error: class, interface, or enum expected
    cout << res;
    ^
Main.java:34: error: class, interface, or enum expected
    return 0;
    ^
Main.java:35: error: class, interface, or enum expected
}
^
36 errors
stdout
Standard output is empty