提出 #17441824


ソースコード 拡げる

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

#define fcout cout << fixed << setprecision(18)

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll N; cin >> N;
  vector<double> A(N); for (ll i = 0; i < N; i++) cin >> A[i];

  double m = 0, m1 = 0, m2 = 0;
  for (ll i = 0; i < N; i++) {
    m += abs(A[i]);
    m1 += (A[i] * A[i]);
    m2 = max(m2, abs(A[i]));
  }

  m1 = sqrt(m1);
  cout << m << '\n';
  fcout << m1 << '\n';
  cout << m2 << '\n';
  return 0;
}

提出情報

提出日時
問題 B - Various distances
ユーザ nakaken88
言語 C++ (GCC 9.2.1)
得点 0
コード長 522 Byte
結果 WA
実行時間 31 ms
メモリ 3988 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 200
結果
AC × 2
AC × 8
WA × 10
セット名 テストケース
Sample sample_01.txt, sample_02.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_10.txt, hand_11.txt, hand_12.txt, 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, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 16 ms 3880 KiB
hand_02.txt AC 22 ms 3808 KiB
hand_03.txt AC 30 ms 3932 KiB
hand_10.txt AC 2 ms 3688 KiB
hand_11.txt AC 2 ms 3792 KiB
hand_12.txt AC 21 ms 3880 KiB
random_01.txt WA 31 ms 3952 KiB
random_02.txt WA 7 ms 3852 KiB
random_03.txt WA 30 ms 3888 KiB
random_04.txt WA 19 ms 3688 KiB
random_05.txt WA 28 ms 3988 KiB
random_06.txt WA 5 ms 3868 KiB
random_07.txt WA 28 ms 3860 KiB
random_08.txt WA 20 ms 3796 KiB
random_09.txt WA 29 ms 3808 KiB
random_10.txt WA 3 ms 3788 KiB
sample_01.txt AC 3 ms 3692 KiB
sample_02.txt AC 1 ms 3684 KiB