Submission #3419326
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 b = 0; b < N; ++b){ for(int i = 0; i < N; ++i){ vector<double> ax, ay, ab, rab; for(int t = 0; t < N; ++t){ ax[b] = x[i] - x[t]; ay[b] = y[i] - y[t]; ab[b] = ax*ax + ay*ay; rab[b] = sqrt(ab); } } } double maxl; minl = *max_element(rab); cout << maxl << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - 2点間距離の最大値 ( The longest distance ) |
User | Kant |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 573 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<double>’ and ‘std::vector<double>’) ab[b] = ax*ax + ay*ay; ^ ./Main.cpp:19:27: error: no match for ‘operator*’ (operand types are ‘std::vector<double>’ and ‘std::vector<double>’) ab[b] = ax*ax + ay*ay; ^ ./Main.cpp:20:25: error: cannot convert ‘std::vector<double>’ to ‘double’ for argument ‘1’ to ‘double sqrt(double)’ rab[b] = sqrt(ab); ^ ./Main.cpp:25:3: error: ‘minl’ was not declared in this scope minl = *max_element(rab); ^ ./Main.cpp:25:23: error: ‘rab’ was not declared in this scope minl = *max_element(rab); ^ ./Main.cpp:25:26: error: ‘max_element’ was not declared in this scope minl = *max_element(rab); ^