Submission #1560474
Source Code Expand
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;
#define PB push_back
#define MP make_pair
#define SZ(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define FORSZ(i,a,v) FOR(i,a,SZ(v))
#define REPSZ(i,v) REP(i,SZ(v))
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }
const int MAXN=200;
const int MOD=998244353;
typedef struct P { int x,y; P() {} P(int x,int y):x(x),y(y) {} } P;
const P operator-(const P &a,const P &b) { return P(a.x-b.x,a.y-b.y); }
const ll operator^(const P &a,const P &b) { return (ll)a.x*b.y-(ll)a.y*b.x; }
bool online(const P &a,const P &b,const P &c) { return ((b-a)^(c-a))==0; }
int n;
P p[MAXN];
int p2[MAXN+1];
void run() {
scanf("%d",&n); REP(i,n) scanf("%d%d",&p[i].x,&p[i].y);
p2[0]=1; REP(i,n) p2[i+1]=(ll)2*p2[i]%MOD;
int ret=(p2[n]+MOD-1)%MOD;
REP(i,n) {
ret=(ret+MOD-1)%MOD;
FOR(j,i+1,n) {
int cnt=0;
FOR(k,j+1,n) if(online(p[i],p[j],p[k])) ++cnt;
//printf("%d and %d -> %d (%d)\n",i,j,cnt,p2[cnt]);
ret=(ret+MOD-p2[cnt])%MOD;
}
}
printf("%d\n",ret);
}
int main() {
run();
return 0;
}
Submission Info
Submission Time |
|
Task |
E - ConvexScore |
User |
krijgertje |
Language |
C++14 (GCC 5.4.1) |
Score |
700 |
Code Size |
1615 Byte |
Status |
AC |
Exec Time |
4 ms |
Memory |
256 KB |
Compile Error
./Main.cpp: In function ‘void run()’:
./Main.cpp:46:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n); REP(i,n) scanf("%d%d",&p[i].x,&p[i].y);
^
./Main.cpp:46:56: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n); REP(i,n) scanf("%d%d",&p[i].x,&p[i].y);
^
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 |
256 KB |
0_001.txt |
AC |
1 ms |
256 KB |
0_002.txt |
AC |
1 ms |
256 KB |
1_003.txt |
AC |
1 ms |
256 KB |
1_004.txt |
AC |
1 ms |
256 KB |
1_005.txt |
AC |
2 ms |
256 KB |
1_006.txt |
AC |
1 ms |
256 KB |
1_007.txt |
AC |
2 ms |
256 KB |
1_008.txt |
AC |
2 ms |
256 KB |
1_009.txt |
AC |
2 ms |
256 KB |
1_010.txt |
AC |
1 ms |
256 KB |
1_011.txt |
AC |
2 ms |
256 KB |
1_012.txt |
AC |
2 ms |
256 KB |
1_013.txt |
AC |
2 ms |
256 KB |
1_014.txt |
AC |
1 ms |
256 KB |
1_015.txt |
AC |
2 ms |
256 KB |
1_016.txt |
AC |
2 ms |
256 KB |
1_017.txt |
AC |
4 ms |
256 KB |
1_018.txt |
AC |
4 ms |
256 KB |
1_019.txt |
AC |
4 ms |
256 KB |
1_020.txt |
AC |
4 ms |
256 KB |
1_021.txt |
AC |
4 ms |
256 KB |
1_022.txt |
AC |
4 ms |
256 KB |
1_023.txt |
AC |
4 ms |
256 KB |
1_024.txt |
AC |
4 ms |
256 KB |
1_025.txt |
AC |
4 ms |
256 KB |
1_026.txt |
AC |
4 ms |
256 KB |
1_027.txt |
AC |
4 ms |
256 KB |
1_028.txt |
AC |
4 ms |
256 KB |
1_029.txt |
AC |
4 ms |
256 KB |
1_030.txt |
AC |
4 ms |
256 KB |
1_031.txt |
AC |
4 ms |
256 KB |
1_032.txt |
AC |
4 ms |
256 KB |
1_033.txt |
AC |
4 ms |
256 KB |
1_034.txt |
AC |
4 ms |
256 KB |
1_035.txt |
AC |
4 ms |
256 KB |