Advertisement
Zuneve

11 class final 2021-2022

Dec 3rd, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. int main() {
  5. long long M=8143989, N=100000000;
  6. vector <vector<int>> mas1 = {{5,5,5,5,5,5,5,5,},
  7. {5,2,3,7,4,0,1,6},
  8. {5,3,4,1,5,3,4,1},
  9. {5,7,1,2,4,6,3,0},
  10. {5,4,5,4,5,4,5,4},
  11. {5,0,3,6,4,2,1,7},
  12. {5,1,4,3,5,1,4,3},
  13. {5,6,1,0,4,7,3,2}};
  14. //L=N
  15. //K=M
  16. for (long long L=10000000; L>0; L--) {
  17. vector <vector <int>> mas(16, vector <int>(8));
  18. int K=8143989, L1=L;
  19. while (K>0) {
  20. int i = 0;
  21. while (i<8) {
  22. int j = 0;
  23. while (j<8) {
  24. if ((i*j)%8==K%8) {
  25. mas[i][j]=L1%8;
  26. } j++;
  27. } i++;
  28. } L1/=8;
  29. K/=8;
  30. } if (mas==mas1) {
  31. cout << L;
  32. break;
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement