Submission #22937


Source Code Expand

#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <vector>
#include <cstdio>
#include <sstream>
#include <complex>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

typedef long long       li;
typedef vector<li>      vi;
typedef complex<double> pt;
typedef pair<pt, pt>    line;
typedef pair<li, li>    pi;
typedef vector<string>  vs;

#define rep(i,to)       for(li i=0;i<((li)to);i++)
#define foreach(it,set) for(__typeof((set).begin()) it=(set).begin();it!=(set).end();it++)
#define all(v)          v.begin(), v.end()

inline li bit(li n){ return 1LL<<n; }
template <class T> ostream& operator<<(ostream& os, vector<T> x){
  foreach(it, x) os << *it << ' ';
  return os;
}
template <class T> inline void dbg(T x){
  // return;
  cerr << x << endl; 
}

li vx[8] = {1, -1, 0,  0, -1, 1,  1, -1};
li vy[8] = {0,  0, 1, -1, -1, 1, -1,  1};

typedef complex<double> pt;

int main(){
  li n;
  cin >> n;
  vector<pt> p(n);
  double ans = 0;
  rep(i, n){
    cin >> p[i].real() >> p[i].imag();
  }
  rep(i,n){
    for(int j=i+1; j<n; j++){
      ans = max(ans, abs(p[i] - p[j]));
    }
  }
  printf("%.9f\n", ans);
  return 0;
}

Submission Info

Submission Time
Task A - 2点間距離の最大値 ( The longest distance )
User amylase
Language C++ (G++ 4.6.4)
Score 100
Code Size 1272 Byte
Status AC
Exec Time 23 ms
Memory 816 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 26
Set Name Test Cases
All 00_max.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rnd_00.txt, 01_rnd_01.txt, 01_rnd_02.txt, 01_rnd_03.txt, 01_rnd_04.txt, 01_rnd_05.txt, 01_rnd_06.txt, 01_rnd_07.txt, 01_rnd_08.txt, 01_rnd_09.txt, 01_rnd_10.txt, 01_rnd_11.txt, 01_rnd_12.txt, 01_rnd_13.txt, 01_rnd_14.txt, 01_rnd_15.txt, 01_rnd_16.txt, 01_rnd_17.txt, 01_rnd_18.txt, 01_rnd_19.txt
Case Name Status Exec Time Memory
00_max.txt AC 23 ms 788 KB
00_sample_01.txt AC 21 ms 788 KB
00_sample_02.txt AC 21 ms 796 KB
00_sample_03.txt AC 21 ms 760 KB
00_sample_04.txt AC 21 ms 788 KB
00_sample_05.txt AC 21 ms 760 KB
01_rnd_00.txt AC 21 ms 812 KB
01_rnd_01.txt AC 22 ms 788 KB
01_rnd_02.txt AC 22 ms 792 KB
01_rnd_03.txt AC 22 ms 792 KB
01_rnd_04.txt AC 20 ms 784 KB
01_rnd_05.txt AC 21 ms 788 KB
01_rnd_06.txt AC 20 ms 796 KB
01_rnd_07.txt AC 21 ms 800 KB
01_rnd_08.txt AC 21 ms 788 KB
01_rnd_09.txt AC 20 ms 784 KB
01_rnd_10.txt AC 20 ms 816 KB
01_rnd_11.txt AC 21 ms 764 KB
01_rnd_12.txt AC 22 ms 788 KB
01_rnd_13.txt AC 23 ms 792 KB
01_rnd_14.txt AC 22 ms 776 KB
01_rnd_15.txt AC 20 ms 784 KB
01_rnd_16.txt AC 23 ms 756 KB
01_rnd_17.txt AC 22 ms 780 KB
01_rnd_18.txt AC 21 ms 764 KB
01_rnd_19.txt AC 21 ms 788 KB