提出 #58705626


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main(){
  cout << fixed << setprecision(6);
  int i,n,x,y,xp=0,yp=0;
  double dis=0;
  cin >> n;

 for(i=0 ;i < n ; i++){
  cin >> x >> y;
  dis += sqrt(pow((x-xp),2)+pow((y-yp),2));
  xp = x;
  yp = y;
 }

  dis += sqrt(pow((0-xp),2)+pow((0-yp),2));

 cout << dis << endl;
 
} 

提出情報

提出日時
問題 B - Traveling Takahashi Problem
ユーザ scentream
言語 C++ 20 (gcc 12.2)
得点 150
コード長 349 Byte
結果 AC
実行時間 114 ms
メモリ 3828 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 150 / 150
結果
AC × 3
AC × 14
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
random_01.txt AC 42 ms 3792 KiB
random_02.txt AC 20 ms 3736 KiB
random_03.txt AC 42 ms 3772 KiB
random_04.txt AC 9 ms 3824 KiB
random_05.txt AC 104 ms 3824 KiB
random_06.txt AC 15 ms 3704 KiB
random_07.txt AC 104 ms 3804 KiB
random_08.txt AC 4 ms 3792 KiB
random_09.txt AC 1 ms 3772 KiB
random_10.txt AC 1 ms 3640 KiB
random_11.txt AC 114 ms 3772 KiB
sample_01.txt AC 1 ms 3692 KiB
sample_02.txt AC 1 ms 3616 KiB
sample_03.txt AC 1 ms 3828 KiB