Submission #1632041
Source Code Expand
#include<cstdio> #include<algorithm> using namespace std; const int N=220,P=998244353; int i,j,k,n,m,ch,ans,g; int tm2[N]; struct point { int x,y; bool operator < (const point &n) const { if (x==n.x) return y<n.y; return x<n.x; } } A[N],B[N]; void R(int &x) { x=0;ch=getchar(); while (ch<'0' || '9'<ch) ch=getchar(); while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar(); } int gcd(int a,int b) { if (!b) return a; return gcd(b,a%b); } int main() { R(n); tm2[0]=1; for (i=1;i<=n;i++) tm2[i]=(tm2[i-1]+tm2[i-1])%P; for (i=1;i<=n;i++) R(A[i].x),R(A[i].y); sort(A+1,A+n+1); ans=1; for (i=1;i<=n;i++) { m=0; ans=(ans+1)%P; for (j=i+1;j<=n;j++) { m++; B[m].x=A[j].x-A[i].x; B[m].y=A[j].y-A[i].y; if (B[m].y<0) g=gcd(B[m].x,-B[m].y); else g=gcd(B[m].x,B[m].y); B[m].x/=g; B[m].y/=g; } sort(B+1,B+m+1); B[m+1].x=-1; k=1; for (j=1;j<=m;j++) { if (B[j].x==B[j+1].x && B[j].y==B[j+1].y) k++; else { ans=(ans+tm2[k]-1)%P; k=1; } } } ans=(tm2[n]+P-ans)%P; printf("%d\n",ans); }
Submission Info
Submission Time | |
---|---|
Task | E - ConvexScore |
User | jiyutian |
Language | C++14 (GCC 5.4.1) |
Score | 700 |
Code Size | 1097 Byte |
Status | AC |
Exec Time | 16 ms |
Memory | 128 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 700 / 700 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 1_027.txt, 1_028.txt, 1_029.txt, 1_030.txt, 1_031.txt, 1_032.txt, 1_033.txt, 1_034.txt, 1_035.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 1 ms | 128 KB |
0_001.txt | AC | 1 ms | 128 KB |
0_002.txt | AC | 1 ms | 128 KB |
1_003.txt | AC | 1 ms | 128 KB |
1_004.txt | AC | 1 ms | 128 KB |
1_005.txt | AC | 1 ms | 128 KB |
1_006.txt | AC | 1 ms | 128 KB |
1_007.txt | AC | 1 ms | 128 KB |
1_008.txt | AC | 1 ms | 128 KB |
1_009.txt | AC | 16 ms | 128 KB |
1_010.txt | AC | 1 ms | 128 KB |
1_011.txt | AC | 1 ms | 128 KB |
1_012.txt | AC | 1 ms | 128 KB |
1_013.txt | AC | 1 ms | 128 KB |
1_014.txt | AC | 1 ms | 128 KB |
1_015.txt | AC | 1 ms | 128 KB |
1_016.txt | AC | 1 ms | 128 KB |
1_017.txt | AC | 3 ms | 128 KB |
1_018.txt | AC | 2 ms | 128 KB |
1_019.txt | AC | 2 ms | 128 KB |
1_020.txt | AC | 2 ms | 128 KB |
1_021.txt | AC | 2 ms | 128 KB |
1_022.txt | AC | 2 ms | 128 KB |
1_023.txt | AC | 2 ms | 128 KB |
1_024.txt | AC | 2 ms | 128 KB |
1_025.txt | AC | 2 ms | 128 KB |
1_026.txt | AC | 1 ms | 128 KB |
1_027.txt | AC | 1 ms | 128 KB |
1_028.txt | AC | 1 ms | 128 KB |
1_029.txt | AC | 2 ms | 128 KB |
1_030.txt | AC | 2 ms | 128 KB |
1_031.txt | AC | 2 ms | 128 KB |
1_032.txt | AC | 2 ms | 128 KB |
1_033.txt | AC | 2 ms | 128 KB |
1_034.txt | AC | 2 ms | 128 KB |
1_035.txt | AC | 1 ms | 128 KB |