|
|
本帖最后由 〇〇 于 2021-10-14 11:04 编辑
总的划线组合数:c(6,3)*c(6,3),全都列举一遍,就能验证答案
create table chess(c int , r int, pawn int),某个点有子则pawn=1,否则=0
select count(*) from t where c not in(1,2,3) and r not in (1,2,3)之类
---
create table chess(r int,c int,p int);
insert into chess
select r,c,1 from(select r from generate_series(1,6)r)r,
(select c from generate_series(1,6)c)c;
delete from chess where c>=4 and r>=4 and (c,r) not in ((4,4));
select count(*) from chess where r not in(1,2,3) and c not in(1,2,3);
|
|