Submission #1109023

# Submission time Handle Problem Language Result Execution time Memory
1109023 2024-11-05T19:32:03 Z Ak_16 Fancy Fence (CEOI20_fancyfence) C++17
0 / 100
6 ms 1872 KB
#include <iostream>
using namespace std;

int main() 
{
    int n; int h[200005]; int w[200005];
    cin>>n;
    for(int i=1; i<=n; i++){cin>>h[i];}
    for(int i=1; i<=n; i++){cin>>w[i];}
    
    int ans=0; int p=1e9+7;
    for(int i=1; i<=n; i++){
      ans += (w[i] * (w[i]+1) / 2 % p) % p * (h[i] * (h[i]+1) / 2 % p) % p; ans %= p; cout<<ans<<" ";
    }
    for(int i=1; i<n; i++){
      int mn=h[i];
      for(int j=i+1; j<=n; j++){
        mn=min(mn, h[j]);
        ans += w[i] * w[j] % p * (mn * (mn+1) / 2 % p) % p; ans %= p;
      }
    }
    cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -