Submission #444993

#TimeUsernameProblemLanguageResultExecution timeMemory
444993fuad27Fancy Fence (CEOI20_fancyfence)C++14
0 / 100
1085 ms204 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define mod 1000000007 int M(int a, int b) { a%=mod; b%=mod; int sum = 0; for(int i = 0;i<b;i++) { sum+=a; sum%=mod; } return sum; } int32_t main () { int n, m; cin >> n; int sumW = 0; for(int i = 0;i<n;i++) { int h; cin >> h; m = h; m%=mod; } for(int i = 0;i<n;i++) { int w; cin >> w; sumW += w%mod; sumW%=mod; } cout<<M(M(sumW%mod, (sumW+1)%mod), M(m%mod, (m+1)%mod))/4<<"\n"; }

Compilation message (stderr)

fancyfence.cpp: In function 'int32_t main()':
fancyfence.cpp:31:48: warning: 'm' may be used uninitialized in this function [-Wmaybe-uninitialized]
   31 |  cout<<M(M(sumW%mod, (sumW+1)%mod), M(m%mod, (m+1)%mod))/4<<"\n";
      |                                              ~~^~~
#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...