Submission #532873

#TimeUsernameProblemLanguageResultExecution timeMemory
532873PotheSlothFancy Fence (CEOI20_fancyfence)C++17
0 / 100
1 ms328 KiB
#include<bits/stdc++.h> using namespace std; #define int long long int n, w, h; const int mod = (int)1e9+7; int qexp(int a, int b) { a%=mod; int res=1; while(b){ if(b&1)res = res*a%mod; a = a*a%mod; b>>=1; } return res; } int C(int n, int k) { int x = 1, y = 1; for(int i=0; i<k-1; ++i){ y*=n-i; x*=k-i; y%=mod; x%=mod; } return (y*qexp(x,mod-2))% mod; } int tri(int intelligence, int yeet){ return (intelligence*(intelligence-1))*(yeet*(yeet-1))/4%mod; } int32_t main(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); cin>>n; for(int i=0; i<n; ++i){ cin>>h; } for(int i=0; i<n; ++i){ int l; cin>>l; w+=l; } cout<<tri(w, h); 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...