Submission #1013535

#TimeUsernameProblemLanguageResultExecution timeMemory
1013535daffuwuFancy Fence (CEOI20_fancyfence)C++14
12 / 100
452 ms460 KiB
#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

long long n, h[100069], w[100069], smw, ans, mn;
const long long dv = 1e9+7;

long long calc(long long a, long long b)
{
    if (a%2 == 0) a/=2;
    else b/=2;
    return a%dv*(b%dv)%dv;
}

int main() 
{
    long long i, j, up, dw;
    scanf("%lld", &n);
    for (i=1; i<=n; i++)
    {
        scanf("%lld", h+i);
    }
    for (i=1; i<=n; i++)
    {
        scanf("%lld", w+i);
    }
    for (dw=1; dw<=50; dw++)
    {
        for (up=dw; up<=50; up++)
        {
            for (i=1; i<=n; i++)
            {
                mn = 1e12;
                for (j=i; j<=n; j++)
                {
                    mn = min(mn, h[j]);
                    if (mn>=up) ans++;
                }
            }
        }
    }
    printf("%lld\n", ans);   
}

Compilation message (stderr)

fancyfence.cpp: In function 'int main()':
fancyfence.cpp:20:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |     scanf("%lld", &n);
      |     ~~~~~^~~~~~~~~~~~
fancyfence.cpp:23:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |         scanf("%lld", h+i);
      |         ~~~~~^~~~~~~~~~~~~
fancyfence.cpp:27:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |         scanf("%lld", w+i);
      |         ~~~~~^~~~~~~~~~~~~
#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...