Submission #2208875
Source Code Expand
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<stack> #include<map> #include<string> #include<algorithm> #include<cmath> #include<cstdio> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define pb push_back #define P pair<int,int> #define ll __int64 //#define __int64 long long int n; int x[2100]; int y[2100]; int ans1,ans2,ans3; double EPS=1e-10; int main(){ cin>>n; rep(i,n)cin>>x[i]>>y[i]; rep(i,n){ vector<double>sita; rep(j,n){ if(i==j)continue; sita.push_back(180*atan2(y[j]-y[i],x[j]-x[i])/M_PI); } sort(sita.begin(),sita.end()); rep(j,n-1)sita.push_back(sita[j]+360); rep(j,n-1){ //cout<<(lower_bound(sita.begin(),sita.end(),sita[j]+90)-sita.begin())<<" "<<lower_bound(sita.begin(),sita.end(),sita[j]+90-EPS)-sita.begin()<<endl; ans2+=upper_bound(sita.begin(),sita.end(),sita[j]+90)-lower_bound(sita.begin(),sita.end(),sita[j]+90-EPS); ans3+=lower_bound(sita.begin(),sita.end(),sita[j]+180+EPS)-upper_bound(sita.begin(),sita.end(),sita[j]+90); } } cout<<n*(n-1)*(n-2)/6-ans2-ans3<<" "<<ans2<<" "<<ans3<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - 三角形の分類 |
User | pappagukun |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1202 Byte |
Status | WA |
Exec Time | 895 ms |
Memory | 512 KB |
Judge Result
Set Name | sample | subtask01 | subtask02 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 30 | 0 / 70 | ||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt |
subtask01 | 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-handmade00.txt, 01-handmade01.txt, 01-handmade02.txt, 01-handmade03.txt, 01-handmade04.txt, 01-handmade05.txt, sample-01.txt, sample-02.txt |
subtask02 | 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-handmade00.txt, 01-handmade01.txt, 01-handmade02.txt, 01-handmade03.txt, 01-handmade04.txt, 01-handmade05.txt, 02-00.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 02-13.txt, 02-14.txt, 02-15.txt, 02-16.txt, 02-17.txt, 02-18.txt, 02-19.txt, 02-handmade00.txt, 02-handmade01.txt, 02-handmade02.txt, 02-handmade03.txt, 02-handmade04.txt, 02-handmade05.txt, sample-01.txt, sample-02.txt, sample-01.txt, sample-02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-00.txt | AC | 4 ms | 384 KB |
01-01.txt | AC | 2 ms | 512 KB |
01-02.txt | AC | 1 ms | 256 KB |
01-03.txt | AC | 1 ms | 256 KB |
01-04.txt | AC | 1 ms | 256 KB |
01-05.txt | AC | 1 ms | 256 KB |
01-06.txt | WA | 1 ms | 256 KB |
01-07.txt | WA | 3 ms | 256 KB |
01-08.txt | WA | 3 ms | 256 KB |
01-09.txt | WA | 3 ms | 256 KB |
01-10.txt | WA | 3 ms | 256 KB |
01-11.txt | WA | 3 ms | 256 KB |
01-12.txt | WA | 3 ms | 256 KB |
01-13.txt | AC | 3 ms | 256 KB |
01-14.txt | AC | 3 ms | 256 KB |
01-15.txt | WA | 3 ms | 256 KB |
01-16.txt | AC | 3 ms | 256 KB |
01-17.txt | AC | 3 ms | 256 KB |
01-18.txt | AC | 3 ms | 256 KB |
01-19.txt | AC | 3 ms | 256 KB |
01-handmade00.txt | AC | 2 ms | 256 KB |
01-handmade01.txt | AC | 3 ms | 256 KB |
01-handmade02.txt | AC | 2 ms | 256 KB |
01-handmade03.txt | AC | 3 ms | 256 KB |
01-handmade04.txt | AC | 3 ms | 256 KB |
01-handmade05.txt | AC | 3 ms | 256 KB |
02-00.txt | WA | 9 ms | 256 KB |
02-01.txt | WA | 34 ms | 256 KB |
02-02.txt | WA | 34 ms | 256 KB |
02-03.txt | WA | 104 ms | 256 KB |
02-04.txt | WA | 105 ms | 256 KB |
02-05.txt | AC | 105 ms | 256 KB |
02-06.txt | WA | 217 ms | 256 KB |
02-07.txt | WA | 216 ms | 256 KB |
02-08.txt | WA | 217 ms | 256 KB |
02-09.txt | WA | 216 ms | 256 KB |
02-10.txt | WA | 216 ms | 256 KB |
02-11.txt | WA | 216 ms | 256 KB |
02-12.txt | WA | 217 ms | 256 KB |
02-13.txt | WA | 892 ms | 384 KB |
02-14.txt | WA | 893 ms | 384 KB |
02-15.txt | WA | 892 ms | 384 KB |
02-16.txt | WA | 894 ms | 384 KB |
02-17.txt | WA | 891 ms | 384 KB |
02-18.txt | WA | 894 ms | 384 KB |
02-19.txt | WA | 895 ms | 256 KB |
02-handmade00.txt | WA | 417 ms | 256 KB |
02-handmade01.txt | WA | 893 ms | 384 KB |
02-handmade02.txt | WA | 494 ms | 384 KB |
02-handmade03.txt | WA | 893 ms | 384 KB |
02-handmade04.txt | WA | 894 ms | 384 KB |
02-handmade05.txt | WA | 893 ms | 384 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |