QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#799764#9660. Inventoryucup-team004AC ✓112ms3828kbC++23719b2024-12-05 17:50:142024-12-05 17:50:16

Judging History

你现在查看的是最新测评结果

  • [2024-12-05 17:50:16]
  • 评测
  • 测评结果:AC
  • 用时:112ms
  • 内存:3828kb
  • [2024-12-05 17:50:14]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;

void solve() {
    int N, V;
    std::cin >> N >> V;
    
    double ans = 0;
    for (int i = 0; i < N; i++) {
        int x;
        std::cin >> x;
        ans += std::sqrt(x);
    }
    ans *= ans;
    ans /= V;
    std::cout << ans << "\n";
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    std::cout << std::fixed << std::setprecision(10);
    
    int t;
    std::cin >> t;
    
    for (int i = 1; i <= t; i++) {
        std::cout << "Case " << i << ": ";
        solve();
    }
    
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 112ms
memory: 3828kb

input:

100
9 75
32 65 28 96 33 93 48 28 57
8 76
20 90 42 57 53 18 58 94
9 85
29 37 22 94 45 67 60 83 23
6 85
35 93 3 42 6 46
8 92
34 25 17 16 50 5 49 91
9 96
69 100 58 68 81 32 88 41 64
9 54
13 95 25 6 59 74 58 31 35
8 93
13 80 10 59 85 18 16 70
7 82
44 28 8 76 8 87 53
8 69
100 2 73 14 100 52 9 89
9 54
74 ...

output:

Case 1: 54.5558803532
Case 2: 42.4855514344
Case 3: 45.8081943049
Case 4: 12.8151361890
Case 5: 21.8162222323
Case 6: 54.9179959917
Case 7: 58.4582526534
Case 8: 26.0517035971
Case 9: 22.4512376963
Case 10: 41.2418055694
Case 11: 80.9015968430
Case 12: 38.6770066919
Case 13: 60.8876864496
Case 14: 9...

result:

ok 100 lines

Extra Test:

score: 0
Extra Test Passed