Submission #3419344


Source Code Expand

#include<iostream>
#include<vector>
#include<math.h>
#include<stdio.h>
using namespace std;
int main()
{
  int N; cin >> N;
  vector<int> x(N), y(N);
  for(int i = 0; i < N; ++i){
    cin >> x[i] >> y[i];
  }
  for(int c = 0; c < N; ++c){
    for(int i = 0; i < N; ++i){
      vector<int> ax, ay, ab;
      for(int t = 0; t < N; ++t){
        ax[c] = x[i] - x[t];
        ay[c] = y[i] - y[t];
        ab[c] = ax*ax + ay*ay;
      }
    }
  }
  double rab;
  rab = sqrt(*max_element(ab));
  cout << rab << endl;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:19:19: error: no match for ‘operator*’ (operand types are ‘std::vector<int>’ and ‘std::vector<int>’)
         ab[c] = ax*ax + ay*ay;
                   ^
./Main.cpp:19:27: error: no match for ‘operator*’ (operand types are ‘std::vector<int>’ and ‘std::vector<int>’)
         ab[c] = ax*ax + ay*ay;
                           ^
./Main.cpp:24:27: error: ‘ab’ was not declared in this scope
   rab = sqrt(*max_element(ab));
                           ^
./Main.cpp:24:29: error: ‘max_element’ was not declared in this scope
   rab = sqrt(*max_element(ab));
                             ^