Submission #445012

#TimeUsernameProblemLanguageResultExecution timeMemory
445012fuad27Fancy Fence (CEOI20_fancyfence)C++14
0 / 100
1 ms204 KiB
#include<bits/stdc++.h> using namespace std; #define mod 1000000007 typedef long long ll; #define int long long ll rec(ll a, ll b) { ll x = 1; if(a%2 == 0) { x*=(a/2)%mod; x*=(a+1); } else { x*=((a+1)/2)%mod; x*=a; } ll y = 1; if(b%2 == 0) { y*=(b/2)%mod; y*=b+1; } else { y*=((b+1)/2)%mod; y*=b; } return (x%mod * y%mod)%mod; } int32_t main () { ll n, m; cin >> n; ll sumW = 0; for(ll i = 0;i<n;i++) { ll h; cin >> h; m = h; } for(ll i = 0;i<n;i++) { ll w; cin >> w; sumW += w; } cout<<rec(sumW, m)<<endl; }

Compilation message (stderr)

fancyfence.cpp: In function 'int32_t main()':
fancyfence.cpp:42:19: warning: 'm' may be used uninitialized in this function [-Wmaybe-uninitialized]
   42 |  cout<<rec(sumW, m)<<endl;
      |                   ^
#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...