Submission #534863

# Submission time Handle Problem Language Result Execution time Memory
534863 2022-03-09T04:44:28 Z mjhmjh1104 Fancy Fence (CEOI20_fancyfence) C++17
15 / 100
29 ms 1040 KB
#include <cstdio>

const int MOD = 1e9 + 7;

int n, h[100006], w[100006];
long long W;

int main() {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", h + i);
    for (int i = 0; i < n; i++) scanf("%d", w + i);
    for (int i = 0; i < n; i++) W = (W + w[i]) % MOD;
    printf("%lld", 1LL * (1LL * W * (W + 1) / 2 % MOD) * (1LL * h[0] * (h[0] + 1) / 2 % MOD) % MOD);
}

Compilation message

fancyfence.cpp: In function 'int main()':
fancyfence.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
fancyfence.cpp:10:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     for (int i = 0; i < n; i++) scanf("%d", h + i);
      |                                 ~~~~~^~~~~~~~~~~~~
fancyfence.cpp:11:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     for (int i = 0; i < n; i++) scanf("%d", w + i);
      |                                 ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 3 ms 332 KB Output is correct
3 Correct 13 ms 548 KB Output is correct
4 Correct 29 ms 1008 KB Output is correct
5 Correct 29 ms 1040 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -