Submission #3002834


Source Code Expand

#include<iostream>
#include<string>
#include<math.h>

using namespace std;
int main(void){
  int N;
  int x[100], y[100];
  long max = 0, temp;
  cin >> N;
  for(int i = 0; i < 100; i++){
    cin >> x[i] >> y[i];
  }
  //点を1個固定して,それ以外の点全てとの長さを求める
  for(int i = 0; i < x.size(); i++){
    for(int j = i; j < x.size(); j++){
      temp = sqrt(pow(x[i] - x[j], 2.0) + pow(y[i] - y[j], 2.0));
      if(temp > max){
        max = temp;
      }
    }
  }
  cout << max << endl;
  return 0;
}

Submission Info

Submission Time
Task A - 2点間距離の最大値 ( The longest distance )
User AyaTaka_chemi
Language C++14 (GCC 5.4.1)
Score 0
Code Size 559 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:15:24: error: request for member ‘size’ in ‘x’, which is of non-class type ‘int [100]’
   for(int i = 0; i < x.size(); i++){
                        ^
./Main.cpp:16:26: error: request for member ‘size’ in ‘x’, which is of non-class type ‘int [100]’
     for(int j = i; j < x.size(); j++){
                          ^