Submission #28400471
Source Code Expand
#include<iostream>
#include <fstream>
#include<vector>
#include <cmath>
using namespace std;
int main(){
int N, x, y;
cin >> N;
vector< pair<int, int> > array;
for (int i=0; i<N; i++){
cin >> x >> y;
array.push_back(make_pair(x, y));
}
double dist, max_dist = 0;
for (int i=0; i<N; i++){
for (int j=i+1; j<N; j++){
dist = pow(array[i].first - array[j].first, 2) + pow(array[i].second - array[j].second, 2);
if (dist > max_dist) max_dist = dist;
}
}
double a = sqrt(max_dist);
cout << fixed << setprecision(10) << a << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Longest Segment |
| User | gackel |
| Language | C++ (Clang 10.0.0) |
| Score | 200 |
| Code Size | 668 Byte |
| Status | AC |
| Exec Time | 6 ms |
| Memory | 3256 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, example0.txt, example1.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 6 ms | 3188 KiB |
| 001.txt | AC | 2 ms | 3208 KiB |
| 002.txt | AC | 2 ms | 3008 KiB |
| 003.txt | AC | 2 ms | 3152 KiB |
| 004.txt | AC | 2 ms | 3076 KiB |
| 005.txt | AC | 2 ms | 3020 KiB |
| 006.txt | AC | 2 ms | 3196 KiB |
| 007.txt | AC | 2 ms | 3256 KiB |
| 008.txt | AC | 2 ms | 3012 KiB |
| 009.txt | AC | 3 ms | 3052 KiB |
| 010.txt | AC | 2 ms | 3168 KiB |
| example0.txt | AC | 2 ms | 3148 KiB |
| example1.txt | AC | 2 ms | 3020 KiB |