Submission #22933


Source Code Expand

#include <cstdlib>
#include <cstring>
#include <memory>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>

#define DEBUG
#ifdef DEBUG
#define DBG(...) cerr << #__VA_ARGS__ << ": " << __VA_ARGS__ << endl
#define DV(...) cerr << __VA_ARGS__ << endl
#define _D(fmt, ...) printf("%10s %3d : " fmt,__FUNCTION__,__LINE__,__VA_ARGS__)
#define _DE(fmt, ...) fprintf(stderr, "%10s %3d : " fmt,__FUNCTION__,__LINE__,__VA_ARGS__)
#else
#define DBG(...)
#define DV(...)
#define _D(fmt, ...)
#define _DE(fmt, ...)
#endif

typedef signed long long s64;
typedef unsigned long long u64;

#define _PE(...) printf(__VA_ARGS__); fprintf(stderr, __VA_ARGS__);
#define _E(...) fprintf(stderr, __VA_ARGS__)
#undef _P
#define _P(...) printf(__VA_ARGS__)

#define FOR(x,to) for(x=0;x<to;x++)
#define FOR2(x,from,to) for(x=from;x<to;x++)
#define ZERO(a) memset(a,0,sizeof(a))
void _fill_int(int* p,int val,int rep) {int i;	FOR(i,rep) p[i]=val;}
#define FILL_INT(a,val) _fill_int((int*)a,val,sizeof(a)/4)
#define ZERO2(a,b) memset(a,0,b)
#define MINUS(a) _fill_int((int*)a,-1,sizeof(a)/4)
#define GETs(x) scanf("%s",x);
int GETi() { int i;scanf("%d",&i); return i;}
#define GET1(x) scanf("%d",x);
#define GET2(x,y) scanf("%d%d",x,y);
#define GET3(x,y,z) scanf("%d%d%d",x,y,z);

#define EPS (1e-11)
template <class T> T sqr(T val){ return val*val;}

//-------------------------------------------------------

int N;
int X[101],Y[101];




void solve() {
	int f;
	int m,d,i,j;
	double max=0,t;
	
	N=GETi();
	FOR(i,N) {
		X[i]=GETi();
		Y[i]=GETi();
	}
	FOR(i,N) {
		FOR(j,N) {
			t=sqrt((X[i]-X[j])*(X[i]-X[j])+(Y[i]-Y[j])*(Y[i]-Y[j]));
			if(t>max) max=t;
		}
	}
		
	
	_P("%.9f\n",max);
}

void init() {
}

int main(int argc,char** argv){
	int loop,loops;
	long long span;
	char tmpline[1000];
	struct timeval start,end,ts;
	
	if(argc>1) {
		freopen(argv[1], "r", stdin);
	}
	
	gettimeofday(&ts,NULL);
	
	init();
	solve();
	
	start = ts;
	span = (end.tv_sec - start.tv_sec)*1000000LL + (end.tv_usec - start.tv_usec);
	//_E("**Total time: %lld ms\n",span/1000);
	
	return 0;
	
}


Submission Info

Submission Time
Task A - 2点間距離の最大値 ( The longest distance )
User kmjp
Language C++ (G++ 4.6.4)
Score 100
Code Size 2435 Byte
Status AC
Exec Time 25 ms
Memory 900 KB

Compile Error

./Main.cpp: In function ‘int main(int, char**)’:
./Main.cpp:99:31: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp: In function ‘int GETi()’:
./Main.cpp:52:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

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 24 ms 792 KB
00_sample_01.txt AC 21 ms 900 KB
00_sample_02.txt AC 22 ms 792 KB
00_sample_03.txt AC 25 ms 792 KB
00_sample_04.txt AC 21 ms 792 KB
00_sample_05.txt AC 21 ms 796 KB
01_rnd_00.txt AC 22 ms 764 KB
01_rnd_01.txt AC 22 ms 788 KB
01_rnd_02.txt AC 22 ms 784 KB
01_rnd_03.txt AC 21 ms 788 KB
01_rnd_04.txt AC 22 ms 784 KB
01_rnd_05.txt AC 22 ms 768 KB
01_rnd_06.txt AC 21 ms 792 KB
01_rnd_07.txt AC 21 ms 792 KB
01_rnd_08.txt AC 21 ms 792 KB
01_rnd_09.txt AC 22 ms 792 KB
01_rnd_10.txt AC 22 ms 792 KB
01_rnd_11.txt AC 22 ms 788 KB
01_rnd_12.txt AC 22 ms 796 KB
01_rnd_13.txt AC 22 ms 788 KB
01_rnd_14.txt AC 22 ms 820 KB
01_rnd_15.txt AC 21 ms 788 KB
01_rnd_16.txt AC 22 ms 792 KB
01_rnd_17.txt AC 21 ms 792 KB
01_rnd_18.txt AC 22 ms 768 KB
01_rnd_19.txt AC 22 ms 788 KB