結果
| 問題 | No.1041 直線大学 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-06-28 02:55:00 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 381 bytes | 
| コンパイル時間 | 2,156 ms | 
| コンパイル使用メモリ | 198,656 KB | 
| 最終ジャッジ日時 | 2025-01-11 13:10:57 | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| 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)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;
}
            
            
            
        