Submission #4044712


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef vector<LL> VI;
typedef vector<VI> VVI;
typedef pair<LL, LL> PII;
typedef vector<string> VS;
inline LL toInt(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(x,c) for(auto x: (c))
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define REVERSE(c) reverse((c).begin(), (c).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define STABLE_SORT(c) stable_sort((c).begin(),(c).end())
#define STABLE_RSORT(c) stable_sort((c).rbegin(),(c).rend())
#define UNIQUE(c) SORT(c); (c).erase(unique((c).begin(), (c).end()), (c).end());
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
const double INF = 1e7;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
#define dump(x)  cerr << #x << " = " << (x) << endl;


int main() {
	LL N;
	cin >> N;
	VI X(N), Y(N);
	REP(i, N) {
		cin >> X[i] >> Y[i];
	}

	double max_l = 0.;
	REP(i, N - 1) {
		FOR(j, i, N) {
			double l = abs(X[i] - X[j]) * abs(X[i] - X[j]) + abs(Y[i] - Y[j]) * abs(Y[i] - Y[j]);
			if (l > max_l) {
				max_l = l;
			}
		}
	}

	cout << sqrt(max_l) << endl;
	
    return 0;
}

Submission Info

Submission Time
Task A - 2点間距離の最大値 ( The longest distance )
User yetnone
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1410 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 26
Set Name Test Cases
All 00_max.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rnd_00.txt, 01_rnd_01.txt, 01_rnd_02.txt, 01_rnd_03.txt, 01_rnd_04.txt, 01_rnd_05.txt, 01_rnd_06.txt, 01_rnd_07.txt, 01_rnd_08.txt, 01_rnd_09.txt, 01_rnd_10.txt, 01_rnd_11.txt, 01_rnd_12.txt, 01_rnd_13.txt, 01_rnd_14.txt, 01_rnd_15.txt, 01_rnd_16.txt, 01_rnd_17.txt, 01_rnd_18.txt, 01_rnd_19.txt
Case Name Status Exec Time Memory
00_max.txt AC 1 ms 256 KB
00_sample_01.txt AC 1 ms 256 KB
00_sample_02.txt AC 1 ms 256 KB
00_sample_03.txt AC 1 ms 256 KB
00_sample_04.txt AC 1 ms 256 KB
00_sample_05.txt AC 1 ms 256 KB
01_rnd_00.txt AC 1 ms 256 KB
01_rnd_01.txt AC 1 ms 256 KB
01_rnd_02.txt AC 1 ms 256 KB
01_rnd_03.txt AC 1 ms 256 KB
01_rnd_04.txt AC 1 ms 256 KB
01_rnd_05.txt AC 1 ms 256 KB
01_rnd_06.txt AC 1 ms 256 KB
01_rnd_07.txt AC 1 ms 256 KB
01_rnd_08.txt AC 1 ms 256 KB
01_rnd_09.txt AC 1 ms 256 KB
01_rnd_10.txt AC 1 ms 256 KB
01_rnd_11.txt AC 1 ms 256 KB
01_rnd_12.txt AC 1 ms 256 KB
01_rnd_13.txt AC 1 ms 256 KB
01_rnd_14.txt AC 1 ms 256 KB
01_rnd_15.txt AC 1 ms 256 KB
01_rnd_16.txt AC 1 ms 256 KB
01_rnd_17.txt AC 1 ms 256 KB
01_rnd_18.txt AC 1 ms 256 KB
01_rnd_19.txt AC 1 ms 256 KB