提出 #28395253
ソースコード 拡げる
#include <string>
#include <iostream>
#include <stack>
#include <vector>
#include <set>
#include <cmath>
int main()
{
int n;
std::cin>>n;
std::cout.precision(13);
std::vector<int> xs;
std::vector<int> ys;
for(int i = 0; i < n; ++i){
int x;
int y;
std::cin>>x>>y;
xs.push_back(x);
ys.push_back(y);
}
long double mx = 0;
for(int i = 0; i < n-1; ++i){
for(int j = i+1; j < n; ++j){
long double ss = (xs[i]-xs[j])*(xs[i]-xs[j])+(ys[i]-ys[j])*(ys[i]-ys[j]);
long double cur = std::sqrt( ss );
if(cur > mx){
mx=cur;
}
}
}
std::cout<<mx<<std::endl;
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Longest Segment |
| ユーザ | Eliphant |
| 言語 | C++ (Clang 10.0.0) |
| 得点 | 200 |
| コード長 | 786 Byte |
| 結果 | AC |
| 実行時間 | 11 ms |
| メモリ | 3212 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 000.txt | AC | 11 ms | 3160 KiB |
| 001.txt | AC | 2 ms | 3140 KiB |
| 002.txt | AC | 3 ms | 3144 KiB |
| 003.txt | AC | 4 ms | 3064 KiB |
| 004.txt | AC | 2 ms | 3200 KiB |
| 005.txt | AC | 2 ms | 3184 KiB |
| 006.txt | AC | 2 ms | 3208 KiB |
| 007.txt | AC | 2 ms | 3184 KiB |
| 008.txt | AC | 3 ms | 3180 KiB |
| 009.txt | AC | 2 ms | 3008 KiB |
| 010.txt | AC | 2 ms | 3140 KiB |
| example0.txt | AC | 2 ms | 3004 KiB |
| example1.txt | AC | 2 ms | 3212 KiB |