SHARE
TWEET

research.cpp

a guest May 22nd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. int main() {
  4.     const int N = 101;
  5.     static char isWin[N][N][N];
  6.     for (int i = 0; i < N; ++i) {
  7.         for (int j = 0; j < N; ++j) {
  8.             for (int k = 0; k < N; ++k) {
  9.                 if (i + j + k == 0) { continue; }
  10.                 for (int x = 1; x < N; ++x) {
  11.                     if (i - x >= 0 && (j != k || j == 0 || k == 0) && (i - x != j || i - x == 0 || j == 0) && (i - x != k || i - x == 0 || k == 0) && !isWin[i-x][j][k]) {
  12.                         isWin[i][j][k] = 1;
  13.                     }
  14.                     if (j - x >= 0 && (i != k || i == 0 || k == 0) && (j - x != i || i == 0 || j - x == 0) && (j - x != k || k == 0 || j - x == 0) && !isWin[i][j-x][k]) {
  15.                         isWin[i][j][k] = 1;
  16.                     }
  17.                     if (k - x >= 0 && (i != j || i == 0 || j == 0) && (k - x != i || i == 0 || k - x == 0) && (k - x != j || j == 0 || k - x == 0) && !isWin[i][j][k-x]) {
  18.                         isWin[i][j][k] = 1;
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.     }
  24.     printf("Bad positions:\n");
  25.     for (int a = 1; a < N; ++a) {
  26.         for (int b = a + 1; b < N; ++b) {
  27.             for (int c = b + 1; c < N; ++c) {
  28.                 if (!isWin[a][b][c]) {
  29.                     printf("\t%d %d %d\n", a, b, c);
  30.                 }
  31.             }
  32.         }
  33.     }
  34.     return 0;
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top