记录编号 204626 评测结果 AAAAAAAAAA
题目名称 [SYOI 2015] Asm.Def找燃料 最终得分 100
用户昵称 Gravatarpppoooiiizzy 是否通过 通过
代码语言 C++ 运行时间 0.009 s
提交时间 2015-11-04 15:15:06 内存使用 0.32 MiB
显示代码纯文本
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<algorithm>
  4. #include<cstring>
  5. #include<vector>
  6. #include<queue>
  7. #include<set>
  8. #include<cmath>
  9.  
  10. const int maxn = 300;
  11. using namespace std;
  12.  
  13. #define INF 0x3fffffff
  14.  
  15. inline int read()
  16. {
  17. int x = 0, f = 1;
  18. char ch = getchar();
  19. while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
  20. while(ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
  21. return x * f;
  22. }
  23.  
  24. struct poi {
  25. int x, y;
  26. }a[maxn];
  27.  
  28. int m, n, Ar, Sa;
  29. int tot, cnt, sum, ans1, ans = -INF;
  30.  
  31. bool cmp(const poi i, const poi j) {
  32. if( i.x != j.x) return i.x < j.x;
  33. else return i.y < j.y;
  34. }
  35.  
  36. void init()
  37. {
  38. n = read();
  39. for(int i = 1; i <= n; i++)
  40. a[i].x = read(), a[i].y = read();
  41. //sort(a + 1, a + n + 1, cmp);
  42. }
  43.  
  44. int main()
  45. {
  46. freopen("asm_fuel.in", "r", stdin);
  47. freopen("asm_fuel.out", "w", stdout);
  48. init();
  49. for(int i = 1; i <= n; i++)
  50. for(int j = i + 1; j <= n; j++) {
  51. int now = 0;
  52. if(a[i].x == a[j].x && a[i].y == a[j].y) continue;
  53. for(int k = 1; k <= n; k++) {
  54. if( (a[k].x - a[i].x) * (a[k].y - a[j].y) == (a[k].x - a[j].x) * (a[k].y - a[i].y) ) now++;
  55. }
  56. ans = max(ans, now);
  57. }
  58.  
  59. cout<<ans<<endl;
  60. return 0;
  61. }