Submission #437656

#TimeUsernameProblemLanguageResultExecution timeMemory
437656shahriarkhanFancy Fence (CEOI20_fancyfence)C++14
15 / 100
37 ms3884 KiB
#include<bits/stdc++.h> using namespace std ; const long long mod = 1e9 + 7 ; int main() { int n ; scanf("%d",&n) ; long long h[n+1] , w[n+1] , ans = 0 , w_sum = 0 ; for(int i = 1 ; i <= n ; ++i) scanf("%lld",&h[i]) ; for(int i = 1 ; i <= n ; ++i) scanf("%lld",&w[i]) ; for(int i = 1 ; i <= n ; ++i) { w_sum = (w_sum + w[i])%mod ; } ans = (ans + ((w_sum*(w_sum+1))/2)%mod)%mod ; ans = (ans*(((h[1]*(h[1]+1))/2)%mod))%mod ; printf("%lld\n",ans) ; return 0 ; }

Compilation message (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:11:40: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     for(int i = 1 ; i <= n ; ++i) scanf("%lld",&h[i]) ;
      |                                   ~~~~~^~~~~~~~~~~~~~
fancyfence.cpp:12:40: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     for(int i = 1 ; i <= n ; ++i) scanf("%lld",&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...