| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
简单水过很不爽。。。#include<iostream>
#include<cstdlib>
#include<cstdio>
using namespace std;
const int LEN = 700;
int x[LEN], y[LEN];
void solve(int n) {
int max(0), temp_max(0);
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
temp_max = 0;
for (int k = j + 1; k < n; ++k) {
if ((x[k] - x[i])*(y[j] - y[i]) == (x[j] - x[i])*(y[k] - y[i]))
++temp_max;
}
max = max > temp_max ? max : temp_max;
}
}
cout << max + 2 << endl;
}
int main() {
int cases;
while (scanf("%d", &cases) && cases) {
for (int i = 0; i < cases; ++i)
scanf("%d%d", x + i, y + i);
solve(cases);
}
return EXIT_SUCCESS;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator