st=>start: for each bit p in s sub1=>subroutine: My Subroutine cond=>condition: if p=1 e=>operation: set dp[i] to 0 io=>condition: if mask[i]=1 ss=>operation: set dp[i] to 1 sp1=>operation: set dp[i] to 0 sp2=>operation: set dp[i] to 1
#include<bits/stdc++.h> #define long long ll #define N 24 #define mod 1000000007 #define FOR(i,n) for(int i=0;i<n;i++) usingnamespace std; int t,n,x[N],y[N];
voidsolve(){ vector<int>line_mask[N]; scanf("%d",&n); for(int i = 0;i < n;i++)scanf("%d %d",&x[i],&y[i]); int m = 1<<n,dp[m]; bool visit[m];memset(visit,0,sizeof(visit)); //calculate all lines O(n^3) for(int i=0;i<n;i++){ line_mask[i].push_back(1<<i); //有可能此點孤立一人,要確保也在裡面 for(int j=i+1;j<n;j++){ int x1 = x[i],y1 = y[i]; int x2 = x[j],y2 = y[j]; if(x1==x2)continue;
double a = (double)((x1*y2)-(x2*y1))/(x1*x2*(x2-x1)); double b = (double)(y1-a*x1*x1)/x1; if(a >= 0)continue;