Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Python shell, size 15, xnorPython shell, size 15, xnor

1215954^1548696 

Obtained by brute force in 1.42 seconds.

Code used to find solution:

#include <iostream> #include <algorithm> int main(){ int digits[] = {1,1,1,2,4,4,5,5,5,6,6,8,9,9}; int ndigits = sizeof(digits)/sizeof(digits[0]); do{ int n1 = 0, n2 = 0; for(int i = 0; i < ndigits - 1; ++i){ n1 = (n1 * 10) + digits[i]; n2 = 0; for(int j = i+1; j < ndigits; ++j) n2 = (n2 * 10) + digits[j]; if((n1 ^ n2) == 339018){ std::cout << n1 << ' ' << n2 << std::endl; return 0; } } }while(std::next_permutation(&digits[0], &digits[ndigits])); } 

Python shell, size 15, xnor

1215954^1548696 

Obtained by brute force in 1.42 seconds.

Code used to find solution:

#include <iostream> #include <algorithm> int main(){ int digits[] = {1,1,1,2,4,4,5,5,5,6,6,8,9,9}; int ndigits = sizeof(digits)/sizeof(digits[0]); do{ int n1 = 0, n2 = 0; for(int i = 0; i < ndigits - 1; ++i){ n1 = (n1 * 10) + digits[i]; n2 = 0; for(int j = i+1; j < ndigits; ++j) n2 = (n2 * 10) + digits[j]; if((n1 ^ n2) == 339018){ std::cout << n1 << ' ' << n2 << std::endl; return 0; } } }while(std::next_permutation(&digits[0], &digits[ndigits])); } 

Python shell, size 15, xnor

1215954^1548696 

Obtained by brute force in 1.42 seconds.

Code used to find solution:

#include <iostream> #include <algorithm> int main(){ int digits[] = {1,1,1,2,4,4,5,5,5,6,6,8,9,9}; int ndigits = sizeof(digits)/sizeof(digits[0]); do{ int n1 = 0, n2 = 0; for(int i = 0; i < ndigits - 1; ++i){ n1 = (n1 * 10) + digits[i]; n2 = 0; for(int j = i+1; j < ndigits; ++j) n2 = (n2 * 10) + digits[j]; if((n1 ^ n2) == 339018){ std::cout << n1 << ' ' << n2 << std::endl; return 0; } } }while(std::next_permutation(&digits[0], &digits[ndigits])); } 
edited body
Source Link
es1024
  • 9.2k
  • 1
  • 29
  • 67
#include <iostream> #include <algorithm> int main(){ int digits[] = {1,1,1,2,4,4,5,5,5,6,6,8,9,9}; int ndigits = sizeof(digits)/sizeof(digits[0]); do{ int n1 = 0, n2 = 0; for(int i = 0; i < ndigits - 1; ++i){ n1 = (n1 * 10) + digits[i]; n2 = 0; for(int j = i+1; j < ndigits; ++j) n2 = (n2 * 10) + digits[j]; if((n1 ^ n2) == 339018){ std::cout << n1 << ' ' << n2 << std::endl; return 0; } } }while(std::next_permutation(&digits[0], &digits[ndigits])); } 
#include <iostream> #include <algorithm> int main(){ int digits[] = {1,1,1,2,4,4,5,5,5,6,6,8,9,9}; int ndigits = sizeof(digits)/sizeof(digits[0]); do{ int n1 = 0, n2 = 0; for(int i = 0; i < ndigits - 1; ++i){ n1 = (n1 * 10) + digits[i]; n2 = 0; for(int j = i+1; j < ndigits; ++j) n2 = (n2 * 10) + digits[j]; if((n1 ^ n2) == 339018){ std::cout << n1 << ' ' << n2 << std::endl; return 0; } } }while(std::next_permutation(&digits[0], &digits[ndigits])); } 
#include <iostream> #include <algorithm> int main(){ int digits[] = {1,1,1,2,4,4,5,5,5,6,6,8,9,9}; int ndigits = sizeof(digits)/sizeof(digits[0]); do{ int n1 = 0, n2 = 0; for(int i = 0; i < ndigits - 1; ++i){ n1 = (n1 * 10) + digits[i]; n2 = 0; for(int j = i+1; j < ndigits; ++j) n2 = (n2 * 10) + digits[j]; if((n1 ^ n2) == 339018){ std::cout << n1 << ' ' << n2 << std::endl; return 0; } } }while(std::next_permutation(&digits[0], &digits[ndigits])); } 
#include <iostream> #include <algorithm> int main(){ int digits[] = {1,1,1,2,4,4,5,5,5,6,6,8,9,9}; int ndigits = sizeof(digits)/sizeof(digits[0]); do{ int n1 = 0, n2 = 0; for(int i = 0; i < ndigits - 1; ++i){ n1 = (n1 * 10) + digits[i]; n2 = 0; for(int j = i+1; j < ndigits; ++j) n2 = (n2 * 10) + digits[j]; if((n1 ^ n2) == 339018){ std::cout << n1 << ' ' << n2 << std::endl; return 0; } } }while(std::next_permutation(&digits[0], &digits[ndigits])); } 
Source Link
es1024
  • 9.2k
  • 1
  • 29
  • 67

Python shell, size 15, xnor

1215954^1548696 

Obtained by brute force in 1.42 seconds.

Code used to find solution:

#include <iostream> #include <algorithm> int main(){ int digits[] = {1,1,1,2,4,4,5,5,5,6,6,8,9,9}; int ndigits = sizeof(digits)/sizeof(digits[0]); do{ int n1 = 0, n2 = 0; for(int i = 0; i < ndigits - 1; ++i){ n1 = (n1 * 10) + digits[i]; n2 = 0; for(int j = i+1; j < ndigits; ++j) n2 = (n2 * 10) + digits[j]; if((n1 ^ n2) == 339018){ std::cout << n1 << ' ' << n2 << std::endl; return 0; } } }while(std::next_permutation(&digits[0], &digits[ndigits])); }