PlanttPastes

euler 49

Jun 25th, 2026
48
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. bool prime(int n) {
  7.     for (int i = 2; i * i <= n; i++) if (!(n % i)) return false;
  8.     return true;
  9. }
  10.  
  11. signed main() {
  12.     ios::sync_with_stdio(0);
  13.     cin.tie(0); cout.tie(0);
  14.     for (int i = 1000; i <= 9999; i++) {
  15.         if (prime(i)) {
  16.             string s = to_string(i);
  17.             sort(s.begin(), s.end());
  18.             vector<int> v;
  19.             do {
  20.                 if (s.starts_with('0')) continue;
  21.                 int n = stoi(s);
  22.                 if (prime(n)) {
  23.                     for (int i = 0; i < v.size(); i++) {
  24.                         for (int j = 0; j < i; j++) {
  25.                             if (v[i] - v[j] == n - v[i]) {
  26.                                 cout << v[j] << v[i] << n << '\n';
  27.                             }
  28.                         }
  29.                     }
  30.                     v.push_back(n);
  31.                 }
  32.             } while (next_permutation(s.begin(), s.end()));
  33.         }
  34.     }
  35. }
Advertisement
Comments
  • User was banned
  • User was banned
  • Rokzalny
    29 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment