結果

問題 No.96 圏外です。
ユーザー roiti46roiti46
提出日時 2014-12-07 21:43:04
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 953 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 64,844 KB
実行使用メモリ 8,280 KB
最終ジャッジ日時 2023-09-02 10:51:04
合計ジャッジ時間 6,022 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 1 ms
4,376 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <math.h>
#define FOR(i,a,b) for(int i=(a); i<b; i++)
#define REP(i,a) FOR(i,0,a)
#define inf (1<<16)
using namespace std;

int G[1000][1000];
int N;

void warshall(){
    REP(k,N)
        REP(i,N)
            REP(j,N)
                G[i][j] = min(G[i][j],G[i][k]+G[k][j]);
}

int S(int ax, int ay, int bx, int by){
    return (bx-ax)*(bx-ax)+(by-ay)*(by-ay);
}

int main(void){
    cin >> N;
    int X[N],Y[N];
    REP(i,N) cin >> X[i] >> Y[i];
    REP(i,N){
        REP(j,N){
            if (S(X[i],Y[i],X[j],Y[j]) <= 100 ){
                G[i][j] = G[j][i] = 1;
            }else{
                G[i][j] = G[j][i] = inf;
            }
        }
    }
    warshall();
    double ans = 0.0;
    REP(i,N)
        REP(j,N)
            if (G[i][j] < inf)
                ans = max(ans,sqrt(S(X[i],Y[i],X[j],Y[j]))+2);
    printf("%.10f",ans);
    return 0;
}
0