QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#620805#5304. Money GameshiftAC ✓50ms3988kbC++234.9kb2024-10-07 21:25:102024-10-07 21:25:10

Judging History

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

  • [2024-10-07 21:25:10]
  • 评测
  • 测评结果:AC
  • 用时:50ms
  • 内存:3988kb
  • [2024-10-07 21:25:10]
  • 提交

answer

// #pragma once

// C
#include <cassert>
#include <cctype>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <csetjmp>
#include <cstdarg>
#include <cstddef>
#include <cstdlib>
#include <cstdint>

// C++
#include <bitset>
#include <complex>
#include <algorithm>
#include <bitset>
#include <functional>
#include <iterator>
#include <limits>
#include <memory>
#include <new>
#include <numeric>
#include <typeinfo>
#include <utility>
#include <array>
#include <atomic>
#include <initializer_list>
#include <ratio>
#include <scoped_allocator>
#include <tuple>
#include <typeindex>
#include <type_traits>

#if _HAS_CXX17
#include <any>
// #include <execution>
#include <optional>
#include <variant>
#include <string_view>
#endif

#if _HAS_CXX20
#include <bit>
#include <compare>
#include <concepts>
#include <numbers>
#include <ranges>
#include <span>
#include <source_location>
#include <version>
#endif

#if _HAS_CXX23
#include <expected>
#include <stdatomic.h>
#if __cpp_impl_coroutine
#include <coroutine>
#endif
#endif

// C
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cuchar>

// C++
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <shared_mutex>

#if _HAS_CXX17
#include <any>
#include <charconv>
// #include <execution>
#include <filesystem>
#include <optional>
#include <memory_resource>
#include <variant>
#endif

#if _HAS_CXX20
#include <barrier>
#include <bit>
#include <compare>
#include <concepts>
#include <format>
#include <latch>
#include <numbers>
#include <ranges>
#include <span>
#include <stop_token>
#include <semaphore>
#include <source_location>
#include <syncstream>
#include <version>
#endif

#if _HAS_CXX23
#include <expected>
#include <spanstream>
#if __has_include(<stacktrace>)
#include <stacktrace>
#endif
#include <stdatomic.h>
#include <stdfloat>
#endif
using i64 = long long;

// https://github.com/Heltion/debug.h/blob/main/debug.h

template <class T, size_t size = std::tuple_size<T>::value> std::string to_debug(T, std::string s = "") requires(not std::ranges::range<T>);
std::string to_debug(auto x) requires requires(std::ostream& os) { os << x; } { return static_cast<std::ostringstream>(std::ostringstream() << x).str(); }
std::string to_debug(std::ranges::range auto x, std::string s = "") requires(not std::is_same_v<decltype(x), std::string>) {
    for (auto xi : x) { s += ", " + to_debug(xi); }
    return "[" + s.substr(s.empty() ? 0 : 2) + "]";
}
template <class T, size_t size> std::string to_debug(T x, std::string s) requires(not std::ranges::range<T>) {
    [&]<size_t... I>(std::index_sequence<I...>) { ((s += ", " + to_debug(get<I>(x))), ...); }(std::make_index_sequence<size>());
    return "(" + s.substr(s.empty() ? 0 : 2) + ")";
}

#define debug(...) std::cerr << __FILE__ ":" << __LINE__ << ": (" #__VA_ARGS__ ") = " << to_debug(std::tuple(__VA_ARGS__)) << "\n"

std::mt19937 rng(std::random_device{}());

void solve() {
    int n;
    std::cin >> n;

    long double sum = 0;
    for(int i = 0; i < n; i ++ ) {
        long double x;
        std::cin >> x;
        sum += x;
    }
    std::cout << std::fixed << std::setprecision(8);
    for(int i = 0; i < n; i ++ ) {
        std::cout << (1 + (i == 0)) * (sum / (n + 1)) << " \n"[i == n - 1];
    }

}

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

    int T = 1;
    // std::cin >> T;
    while(T -- ) {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3888kb

input:

2
4 2

output:

4.00000000 2.00000000

result:

ok 2 numbers

Test #2:

score: 0
Accepted
time: 1ms
memory: 3864kb

input:

2
2 3

output:

3.33333333 1.66666667

result:

ok 2 numbers

Test #3:

score: 0
Accepted
time: 1ms
memory: 3876kb

input:

2
851648 722281

output:

1049286.00000000 524643.00000000

result:

ok 2 numbers

Test #4:

score: 0
Accepted
time: 1ms
memory: 3880kb

input:

3
450762 114467 367746

output:

466487.50000000 233243.75000000 233243.75000000

result:

ok 3 numbers

Test #5:

score: 0
Accepted
time: 1ms
memory: 3740kb

input:

4
2 3 5 1

output:

4.40000000 2.20000000 2.20000000 2.20000000

result:

ok 4 numbers

Test #6:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

5
616288 155735 783782 648639 349827

output:

851423.66666667 425711.83333333 425711.83333333 425711.83333333 425711.83333333

result:

ok 5 numbers

Test #7:

score: 0
Accepted
time: 1ms
memory: 3988kb

input:

6
1 2 5 5 1 2

output:

4.57142857 2.28571429 2.28571429 2.28571429 2.28571429 2.28571429

result:

ok 6 numbers

Test #8:

score: 0
Accepted
time: 0ms
memory: 3692kb

input:

100
283397 377774 494372 487546 143741 314831 934818 229251 78798 395137 407818 18761 516178 734330 838264 433107 858247 174903 905002 445936 58127 253493 844807 215023 37167 11961 885588 176935 156947 82314 21120 373809 226377 712113 302554 613417 368577 604224 811349 182256 179860 424904 544075 16...

output:

848873.90099010 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049505 424436.95049...

result:

ok 100 numbers

Test #9:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

100
5 3 4 3 3 5 1 4 1 5 5 4 2 5 2 4 2 2 5 2 3 4 3 3 1 3 1 5 4 5 4 2 3 1 4 2 2 3 4 5 2 5 2 2 1 2 1 4 2 2 3 4 4 2 1 2 5 3 2 2 1 5 4 2 3 1 3 1 4 5 4 1 1 5 3 3 2 3 5 4 2 4 3 3 2 3 5 2 3 5 5 4 4 1 5 4 5 4 2 1

output:

6.07920792 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.03960396 3.0...

result:

ok 100 numbers

Test #10:

score: 0
Accepted
time: 1ms
memory: 3772kb

input:

1000
752085 536931 226066 866464 865683 685497 869505 833061 583665 542381 226489 183898 682629 584879 968426 414809 258683 315749 204443 89329 66644 255718 884710 690597 216353 59071 257910 665131 979147 688114 99343 929069 829135 674291 849479 242572 654330 268521 645445 96088 960241 507763 482377...

output:

1019649.56843157 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.78421578 509824.7842...

result:

ok 1000 numbers

Test #11:

score: 0
Accepted
time: 1ms
memory: 3872kb

input:

1000
5 4 4 5 2 2 1 1 2 4 4 5 4 4 5 4 2 1 1 5 5 3 5 2 4 3 2 2 5 4 4 3 2 1 1 1 2 5 3 4 4 5 2 5 4 1 5 4 3 2 1 5 5 5 3 4 1 4 1 5 3 4 2 5 5 4 2 3 4 2 3 5 2 4 4 4 3 4 2 3 1 1 3 5 5 3 4 3 5 3 1 5 5 4 1 1 5 3 1 1 5 1 4 2 2 3 1 2 2 3 2 3 3 5 4 1 2 4 3 5 2 5 1 3 4 4 4 5 5 3 2 4 1 4 2 4 4 4 4 4 2 3 3 1 4 4 4 3...

output:

6.02197802 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.01098901 3.0...

result:

ok 1000 numbers

Test #12:

score: 0
Accepted
time: 3ms
memory: 3744kb

input:

10000
555267 855028 164928 642327 322766 137905 892693 768608 595311 65776 289777 973757 430764 328540 522735 2683 718992 189574 472939 64268 909931 465314 133959 665735 231887 255624 980840 597349 306389 287285 166135 812422 971286 552328 601121 51946 888371 940805 141463 481145 8270 701461 63887 9...

output:

989682.61773823 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886911 494841.30886...

result:

ok 10000 numbers

Test #13:

score: 0
Accepted
time: 5ms
memory: 3744kb

input:

10000
2 5 2 1 2 1 2 5 2 3 2 4 2 5 5 2 4 4 4 4 1 2 4 3 4 3 2 5 3 5 2 4 3 5 5 2 4 5 4 4 5 1 4 1 4 4 5 5 5 4 3 3 2 2 3 4 3 2 2 3 4 1 1 5 5 2 3 5 4 5 1 3 2 5 3 5 3 1 2 1 1 5 2 1 4 3 3 4 1 3 1 2 1 3 1 5 1 1 1 3 5 4 2 5 4 2 1 5 5 3 2 1 4 1 1 3 3 3 1 4 4 5 3 3 5 2 3 2 2 2 3 2 1 3 5 1 2 4 3 5 5 2 4 3 5 1 1 ...

output:

263.89141086 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 131.94570543 1...

result:

ok 10000 numbers

Test #14:

score: 0
Accepted
time: 50ms
memory: 3836kb

input:

100000
779832 554019 543847 331565 726136 264080 431095 49283 742555 692958 230722 850608 314016 458702 247541 403119 84030 489015 116333 72785 944859 505217 418045 620728 535894 595242 693228 419550 169086 398212 721396 606668 933464 99252 230276 337699 585373 807605 279487 518422 91129 863955 5859...

output:

1001386.03045970 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.01522985 500693.0152...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 44ms
memory: 3840kb

input:

100000
3 3 2 1 5 5 5 1 2 5 3 2 4 2 1 5 5 1 5 3 3 5 4 1 2 3 2 3 1 2 4 4 2 5 1 3 4 3 2 3 1 1 5 2 1 3 5 5 3 3 3 1 5 1 1 3 2 4 1 2 4 1 4 4 4 4 3 1 1 5 2 1 1 3 2 3 4 5 2 5 1 4 2 4 1 4 3 3 5 5 3 2 2 1 5 5 2 4 4 4 1 2 3 4 1 1 4 4 4 1 1 3 2 3 3 4 5 4 5 1 1 4 3 3 5 4 1 2 3 4 1 4 3 4 3 2 3 5 2 4 4 3 1 5 3 4 5...

output:

1183.39476605 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 591.69738303 ...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 50ms
memory: 3892kb

input:

99999
40292 282829 216987 948216 868506 49544 574269 238601 310361 979927 485756 943815 434808 910471 442466 72899 831063 686602 179839 38897 581205 374071 117990 21801 603544 489351 782190 725480 834697 491738 934449 964429 635413 752432 955088 489180 349037 635185 296045 687614 140487 715366 32721...

output:

1000519.75778000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.87889000 500259.8788...

result:

ok 99999 numbers

Test #17:

score: 0
Accepted
time: 43ms
memory: 3772kb

input:

99999
3 5 2 4 3 3 3 1 4 3 3 5 4 1 4 5 4 5 1 5 1 2 3 4 3 4 1 4 1 4 3 5 5 5 1 1 4 4 5 4 5 1 2 3 3 5 4 2 5 2 5 1 5 5 5 4 4 1 3 1 3 3 2 3 1 1 3 5 2 2 3 1 3 3 3 3 5 3 2 3 5 1 1 3 4 3 4 2 3 3 5 4 1 2 2 1 4 3 2 4 2 1 2 4 5 4 3 4 5 4 1 2 3 1 2 3 5 5 5 1 4 3 5 5 4 1 1 5 2 4 4 1 4 2 1 4 3 1 5 1 4 4 3 5 2 1 4 ...

output:

1020.87184000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 510.43592000 ...

result:

ok 99999 numbers