結果
問題 | No.1041 直線大学 |
ユーザー |
![]() |
提出日時 | 2020-05-04 02:12:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,613 bytes |
コンパイル時間 | 1,565 ms |
コンパイル使用メモリ | 175,364 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 08:24:39 |
合計ジャッジ時間 | 2,682 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 19 |
ソースコード
#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for(ll i=0; i < (n); i++) #define ALL(v) v.begin(),v.end() #define FOR(i, j, k) for(ll i=j;i<k;i++) #define DUMP(i, v)for(ll i=0;i<v.size();i++)cout<<v[i]<<" " using namespace std; typedef long long int ll; typedef vector<ll> llvec; typedef vector<double> dvec; typedef pair<ll, ll> P; typedef long double ld; struct Edge{ll from, to, cost;}; struct node{ll cost, to; bool friend operator>(node a, node b){ return a.cost>b.cost; } }; ll mod(ll a, ll mod){ ll res = a%mod; if(res<0)res=res + mod; return res; } ll modpow(ll a, ll n, ll mod){ ll res=1; while(n>0){ if(n&1) res=res*a%mod; a=a*a%mod; n>>=1; } return res; } ll modinv(ll a, ll mod){ return modpow(a, mod-2, mod); } ll gcd(ll a, ll b){ ll r = a%b; if(r==0) return b; else return gcd(b, a%b); } bool is_prime(ll n){ ll i = 2; if(n==1)return false; if(n==2)return true; bool res = true; while(i*i <n){ if(n%i==0){ res = false; } i = i+1; } //if(i==1)res = false; if(n%i==0)res=false; return res; } /************************************** ** A main function starts from here ** ***************************************/ int main(){ ll N; cin >> N; llvec x(N), y(N); rep(i, N)cin >> x[i] >> y[i]; map<double, ll> cnt; rep(i, N){ FOR(j, i+1, N){ ll a=x[j]-x[i]; ll b=y[j]-y[i]; if(a==0)cnt[M_PI*0.5]++; else cnt[atan((double)b/a)]++; } } ll ans = 0; for(auto i:cnt){ ans = max(ans, (ll)((1+sqrtl(1+8*i.second))/2)); } cout << ans; return 0; }