# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
445004 | 2021-07-16T08:18:39 Z | fuad27 | Fancy Fence (CEOI20_fancyfence) | C++14 | 1 ms | 204 KB |
#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; x%=mod; } else { x*=((a+1)/2)%mod; x*=a%mod; x%=mod; } if(b%2 == 0) { x*=(b/2)%mod; x*=b+1; x%=mod; } else { x*=((b+1)/2)%mod; x*=b%mod; x%=mod; } return x%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; m%=mod; } for(ll i = 0;i<n;i++) { ll w; cin >> w; sumW += w%mod; sumW%=mod; } cout<<rec(sumW, m)<<endl; }
Compilation message
# | 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 | Incorrect | 1 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 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |