Submission #445021

#TimeUsernameProblemLanguageResultExecution timeMemory
445021fuad27Fancy Fence (CEOI20_fancyfence)C++14
15 / 100
92 ms1424 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define mod 1000000007 #define int long long long long bin(long long x){ x %= mod; return ((x*(x+1))/2)%mod; } long long rec(long long x, long long y){ return (bin(x)*bin(y))%mod; } int32_t main () { int n; cin >> n; ll ans = 0; vector<int> h; for(int i = 0;i<n;i++) { int hi; cin >> hi; h.push_back(hi); } ll sum = 0; for(int i = 0;i<n;i++) { ll w; cin >> w; sum+=w; } cout<<rec(sum, h[0]); }

Compilation message (stderr)

fancyfence.cpp: In function 'int32_t main()':
fancyfence.cpp:16:5: warning: unused variable 'ans' [-Wunused-variable]
   16 |  ll ans = 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...