Submission #868580

#TimeUsernameProblemLanguageResultExecution timeMemory
868580mariaclaraFancy Fence (CEOI20_fancyfence)C++17
12 / 100
1 ms436 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef tuple<int,int,int> trio; const int MAXN = 5e4+10; #define pb push_back #define f first #define s second int n, h[55], w[55], resp; int main() { cin >> n; for(int i = 1; i <= n; i++) cin >> h[i]; for(int i = 1; i <= n; i++) cin >> w[i]; for(int i = 1; i <= n; i++) { for(int j = i, l = 100; j <= n; j++) { l = min(h[j], l); resp += l*(l+1)/2; resp %= (int)(1e9+7); } cout << "\n"; } cout << resp << "\n"; }
#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...