提出 #26919391
ソースコード 拡げる
// Cookie197
// competitive programming is sooo hardd
#pragma GCC optimize("O4,unroll-loops,no-stack-protector")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<string>
#include<iomanip>
#include<math.h>
#include<unordered_map>
#include<numeric>
using namespace std;
void Why_does_competitive_programming_even_exist() {ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void YayXD() {return;}
#define ll long long
#define pii pair<ll,ll>
#define pdd pair<double ,double>
#define mp make_pair
#define mod 998244353
#define endl "\n"
#define inf 1e18
#define Yes_it_does true
#define Does_competitive_programming_exist Yes_it_does
int n;
double x[200005],y[200005];
pdd angle[200005];
bool isequal(double a,double b){
if (abs(a-b)<=1e-8) return true;
return false;
}
bool comp(pdd a,pdd b){
if (a.second<b.second) return true;
return (a.first<b.first);
}
signed main(){
Why_does_competitive_programming_even_exist();
cin>>n;
for (int i=1;i<=n;i++){
cin>>x[i]>>y[i];
angle[i].second=atan2(y[i]-1,x[i]);
angle[i].first=atan2(y[i],x[i]-1);
//cout<<angle[i].first<<" "<<angle[i].second<<endl;
}
sort(angle+1,angle+1+n);
double now=0;
int cnt=0;
for (int i=1;i<=n;i++){
//cout<<angle[i].second<<" "<<angle[i].first<<endl;
//if (now<angle[i].first || isequal(now,angle[i].first)){
if (now<=angle[i].second){
cnt++;
now=angle[i].first;
}
}
cout<<cnt<<endl;
}
提出情報
ジャッジ結果
| セット名 | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 500 | ||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, example0.txt, example1.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 000.txt | AC | 7 ms | 3956 KiB |
| 001.txt | AC | 123 ms | 10312 KiB |
| 002.txt | AC | 117 ms | 10280 KiB |
| 003.txt | AC | 118 ms | 10360 KiB |
| 004.txt | AC | 119 ms | 10272 KiB |
| 005.txt | AC | 57 ms | 6708 KiB |
| 006.txt | AC | 55 ms | 6568 KiB |
| 007.txt | AC | 38 ms | 5532 KiB |
| 008.txt | AC | 75 ms | 7864 KiB |
| 009.txt | AC | 116 ms | 10112 KiB |
| 010.txt | AC | 104 ms | 10280 KiB |
| 011.txt | AC | 106 ms | 10260 KiB |
| 012.txt | AC | 100 ms | 10244 KiB |
| 013.txt | AC | 104 ms | 10276 KiB |
| 014.txt | AC | 76 ms | 8532 KiB |
| 015.txt | AC | 37 ms | 5768 KiB |
| 016.txt | AC | 120 ms | 10212 KiB |
| 017.txt | AC | 116 ms | 10312 KiB |
| 018.txt | AC | 116 ms | 10264 KiB |
| 019.txt | AC | 115 ms | 10212 KiB |
| 020.txt | AC | 87 ms | 8592 KiB |
| 021.txt | AC | 60 ms | 6948 KiB |
| 022.txt | WA | 115 ms | 10264 KiB |
| 023.txt | WA | 119 ms | 10248 KiB |
| 024.txt | WA | 119 ms | 10280 KiB |
| 025.txt | WA | 118 ms | 10244 KiB |
| 026.txt | WA | 119 ms | 10280 KiB |
| 027.txt | WA | 116 ms | 10316 KiB |
| 028.txt | WA | 118 ms | 10324 KiB |
| 029.txt | WA | 118 ms | 10312 KiB |
| 030.txt | WA | 118 ms | 10276 KiB |
| 031.txt | WA | 136 ms | 10324 KiB |
| 032.txt | AC | 117 ms | 10184 KiB |
| 033.txt | AC | 100 ms | 10268 KiB |
| 034.txt | AC | 98 ms | 10312 KiB |
| 035.txt | AC | 118 ms | 10276 KiB |
| 036.txt | AC | 119 ms | 10280 KiB |
| example0.txt | AC | 2 ms | 3976 KiB |
| example1.txt | AC | 3 ms | 4056 KiB |