제출 #534863

#제출 시각아이디문제언어결과실행 시간메모리
534863mjhmjh1104Fancy Fence (CEOI20_fancyfence)C++17
15 / 100
29 ms1040 KiB
#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); }

컴파일 시 표준 에러 (stderr) 메시지

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...