Submission #477493

# Submission time Handle Problem Language Result Execution time Memory
477493 2021-10-02T09:49:09 Z niloyroot Fancy Fence (CEOI20_fancyfence) C++14
0 / 100
1 ms 204 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define forp(i,a,b) for(ll i=a;i<=b;i++)
#define newl '\n'
const ll mod=1000000007;

void solve(){
    ll n; cin>>n;
    ll sum=0,h,c;
    forp(i,1,n){cin>>h;}
    forp(i,1,n){cin>>c; sum+=c; sum%=mod;}
    ll ans=(h*(h+1))/2; ans%=mod; ans*=((sum*(sum+1))/2); ans%=mod;
    cout<<ans<<newl;
}
 
int main() {
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    solve();
}
# 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 -