public void subSolve(ArrayList<String[]> resArr, int[] res, int n, int x) {
		if (x > n - 1) { // DONE
			String[] tmp = new String[n];
			for (int i = 0; i < n; i++) {
				StringBuilder sb = new StringBuilder();
				for (int j = 0; j < n; j++) {
					sb.append(j == res[i] ? 'Q' : '.');
				}
				tmp[i] = sb.toString();
			}
			resArr.add(tmp);
			return;
		}

		for (int i = 0; i < n; i++) {
			boolean flag = true;
			int j = 0;
			// CHECK
			for (j = 0; j < x; j++) {
				if (res[j] == i || Math.abs(res[j] - i) == Math.abs(j - x)) {
					flag = false;
					break;
				}
			}
			if (flag) {
				res[x] = i;
				subSolve(resArr, res, n, x + 1);
				res[x] = -1; // 可有可无，因为不会影响到后续子问题
			}
		}
	}