Submission #628687

#TimeUsernameProblemLanguageResultExecution timeMemory
628687a_aguiloFancy Fence (CEOI20_fancyfence)C++14
15 / 100
96 ms476 KiB
#include<bits/stdc++.h> using namespace std; int MOD = 1e9 + 7; int main(){ int n, h, w; cin >> n; long long int H = 0; for(int i = 0; i < n; ++i){ cin >> H; } long long int W = 0; for(int i = 0; i < n; ++i){ cin >> w; W += w; W%=MOD; } long long chooseh = (H*(H+1)/2)%MOD; long long choosew = (W*(W+1)/2)%MOD; cout << (chooseh*choosew)%MOD << endl; return 0; }

Compilation message (stderr)

fancyfence.cpp: In function 'int main()':
fancyfence.cpp:8:12: warning: unused variable 'h' [-Wunused-variable]
    8 |     int n, h, w;
      |            ^
#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...