結果
問題 |
No.1041 直線大学
|
ユーザー |
|
提出日時 | 2020-06-28 02:56:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 383 bytes |
コンパイル時間 | 1,796 ms |
コンパイル使用メモリ | 198,040 KB |
最終ジャッジ日時 | 2025-01-11 13:11:27 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; int gcd(int a,int b){ if(a%b)return gcd(b,a%b); return b; } int main(){ cin.tie(0),ios::sync_with_stdio(false); int n; cin>>n; unordered_map<int,int>m; for(int i=0;i<n;++i){ int x,y; cin>>x>>y; int g=1; if(x!=0&&y!=0)g=gcd(x,y); ++m[(x/g)*100+y/g]; } int ans=2; for(auto&&i:m)ans=max(ans,i.second); cout<<ans<<"\n"s; }