Submission #1566776
Source Code Expand
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Globalization; using System.Diagnostics; class Myon { public Myon() { } public static int Main() { new Myon().calc(); return 0; } Scanner cin; void calc() { cin = new Scanner(); int N = cin.nextInt(); int[] x = new int[N]; int[] y = new int[N]; for (int i = 0; i < N; i++) { x[i] = cin.nextInt(); y[i] = cin.nextInt(); } long ans = 0; long mod = 998244353; int MAX2 = 300; long[] pow2 = new long[MAX2]; pow2[0] = 0; pow2[1] = 1; for (int i = 2; i < MAX2; i++) { pow2[i] = (pow2[i - 1] * 2 + 1) % mod; } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { long cnt = 0; long cnt2 = 0; for (int k = j + 1; k < N; k++) { cnt++; if (calcT(x[i] - x[k], y[i] - y[k], x[j] - x[k], y[j] - y[k]) == 0) { cnt2++; } } ans += pow2[cnt]; ans -= pow2[cnt2]; ans %= mod; ans += mod; ans %= mod; } } Console.WriteLine(ans); } long calcT(long ax, long ay, long bx, long by) { return (ax * by) - (bx * ay); } } class Scanner { string[] s; int i; char[] cs = new char[] { ' ' }; public Scanner() { s = new string[0]; i = 0; } public string next() { if (i < s.Length) return s[i++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); if (s.Length == 0) return next(); i = 0; return s[i++]; } public int nextInt() { return int.Parse(next()); } public int[] ArrayInt(int N, int add = 0) { int[] Array = new int[N]; for (int i = 0; i < N; i++) { Array[i] = nextInt() + add; } return Array; } public long nextLong() { return long.Parse(next()); } public long[] ArrayLong(int N, long add = 0) { long[] Array = new long[N]; for (int i = 0; i < N; i++) { Array[i] = nextLong() + add; } return Array; } public double nextDouble() { return double.Parse(next()); } public double[] ArrayDouble(int N, double add = 0) { double[] Array = new double[N]; for (int i = 0; i < N; i++) { Array[i] = nextDouble() + add; } return Array; } }
Submission Info
Submission Time | |
---|---|
Task | E - ConvexScore |
User | chokudai |
Language | C# (Mono 4.6.2.0) |
Score | 700 |
Code Size | 3144 Byte |
Status | AC |
Exec Time | 30 ms |
Memory | 13140 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 | 21 ms | 9044 KB |
0_001.txt | AC | 21 ms | 9044 KB |
0_002.txt | AC | 21 ms | 11092 KB |
1_003.txt | AC | 21 ms | 11092 KB |
1_004.txt | AC | 21 ms | 9044 KB |
1_005.txt | AC | 23 ms | 9044 KB |
1_006.txt | AC | 21 ms | 11092 KB |
1_007.txt | AC | 25 ms | 11092 KB |
1_008.txt | AC | 24 ms | 11092 KB |
1_009.txt | AC | 25 ms | 13140 KB |
1_010.txt | AC | 22 ms | 11092 KB |
1_011.txt | AC | 25 ms | 11092 KB |
1_012.txt | AC | 25 ms | 9172 KB |
1_013.txt | AC | 24 ms | 11092 KB |
1_014.txt | AC | 21 ms | 11092 KB |
1_015.txt | AC | 25 ms | 11092 KB |
1_016.txt | AC | 22 ms | 9172 KB |
1_017.txt | AC | 29 ms | 9044 KB |
1_018.txt | AC | 29 ms | 11092 KB |
1_019.txt | AC | 29 ms | 9044 KB |
1_020.txt | AC | 29 ms | 9044 KB |
1_021.txt | AC | 29 ms | 9172 KB |
1_022.txt | AC | 29 ms | 11092 KB |
1_023.txt | AC | 28 ms | 9172 KB |
1_024.txt | AC | 29 ms | 9172 KB |
1_025.txt | AC | 29 ms | 9044 KB |
1_026.txt | AC | 29 ms | 11092 KB |
1_027.txt | AC | 29 ms | 11092 KB |
1_028.txt | AC | 29 ms | 11092 KB |
1_029.txt | AC | 28 ms | 9172 KB |
1_030.txt | AC | 29 ms | 11220 KB |
1_031.txt | AC | 29 ms | 11092 KB |
1_032.txt | AC | 29 ms | 9044 KB |
1_033.txt | AC | 29 ms | 11220 KB |
1_034.txt | AC | 29 ms | 9172 KB |
1_035.txt | AC | 30 ms | 11092 KB |