Submission #906415

#TimeUsernameProblemLanguageResultExecution timeMemory
906415LudisseyFancy Fence (CEOI20_fancyfence)C++14
15 / 100
18 ms2396 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int n,m; int mod=1e9+7; int clc(int x) { return (((x*(x+1)))/(long long)2)%mod; } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n; int H; int width=0; for (int i = 0; i < n; i++) cin >> H; for (int i = 0; i < n; i++) { int x; cin >> x; width+=x; width%=mod; } int outp=(clc(width%mod)*clc(H%mod)); outp%=mod; cout << outp << "\n"; return 0; }
#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...