Grakn Forces 2020 C問題 (1250pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, L, A[1d5];
{
REP(rd_int()){
int i, j;
double sx, sy, x, y, res = 0, tm;
rd(N,L,A(N));
i = 0; j = N-1;
x = 0; y = L;
sx = 1; sy = 1;
while(i <= j){
if( (A[i] - x) / sx <= (y - A[j]) / sy ){
res += tm = (A[i] - x) / sx;
x += tm * sx;
y -= tm * sy;
i++;
sx++;
} else {
res += tm = (y - A[j]) / sy;
x += tm * sx;
y -= tm * sy;
j--;
sy++;
}
}
res += (y - x) / (sx + sy);
wt(res);
}
}
Current time: 2024年05月03日05時48分19秒
Last modified: 2020年10月03日18時45分04秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る
Logged in as: unknown user (not login)