結果
問題 | No.1041 直線大学 |
ユーザー |
![]() |
提出日時 | 2023-08-26 18:10:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 716 bytes |
コンパイル時間 | 1,190 ms |
コンパイル使用メモリ | 106,404 KB |
最終ジャッジ日時 | 2025-02-16 14:45:24 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 22 |
ソースコード
#include<iostream>#include<map>#include<vector>#include <algorithm>#include<math.h>#include <iomanip>#include<set>#include <numeric>using namespace std;int main(){int n, cnt = 2, max1 = -1;cin >> n;vector<vector<int>> v(n, vector<int>(2));for (int i = 0; i < n; i++) cin >> v[i][0] >> v[i][1];for (int i = 0; i < n-2; i++){for (int j = i+1; j < n-1; j++){int xp = v[j][0] - v[i][0], yp = v[j][1] - v[i][1];for (int k = j+1; k < n; k++){if (xp*(v[k][1] - v[i][1]) == yp*(v[k][0]-v[i][0])) cnt++;}}max1 = max(max1, cnt);cnt = 2;}if (n == 2) max1 = 2;cout << max1 << endl;}