# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1191045 | sayadd | Mountains (NOI20_mountains) | C++20 | 2093 ms | 1860 KiB |
/*
author : Sayadd
*/
#include <bits/stdc++.h>
#pragma GCC optimize ("O3", "unroll-all-loops")
#pragma GCC target ("sse4.2")
#define iota ios_base::sync_with_stdio(0); cin.tie(0)
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define No cout << "No\n"
#define Yes cout << "Yes\n"
#define pb push_back
#define ff first
#define ss second
#define lcm(a,b) a/__gcd(a,b)*b
#define dbg(x) cout<<#x<<" = "<<x<<en
#define en "\n"
#define ll long long
#define ull unsigned long long
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pll pair<ll,ll>
using namespace std;
const ll INF = 1LL<<60;
const ll sz = 2e5+5;
const ll MOD = 1e9+7;
ll a[sz];
ll pre[sz];
void solve()
{
ll n; cin>>n;
for(int i=0; i<n; i++) cin>>a[i];
ll say=0;
for(int i=0; i<n; i++)
{
for(int j=i+1; j<n; j++)
{
for(int k=j+1; k<n; k++)
{
if(a[i]<a[j] and a[k]<a[j])
{
say++;
}
}
}
}
cout<<say<<en;
}
signed main()
{
system("color 0A");
iota;
// ll t;cin>>t;for(; t--;)
solve();
}
/**
**/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |