Submission #718338

# Submission time Handle Problem Language Result Execution time Memory
718338 2023-04-04T00:19:13 Z irmuun Boat (APIO16_boat) C++17
0 / 100
2 ms 340 KB
#include<bits/stdc++.h>

using namespace std;

#define pb push_back
#define ll long long
#define ff first
#define ss second
#define all(s) s.begin(),s.end()

const ll mod=1e9+7;

int main(){
    ll n;
    cin>>n;
    ll a[n+5],b[n+5];
    ll dp[n+5];
    for(ll i=1;i<=n;i++){
        cin>>a[i]>>b[i];
    }
    dp[1]=1;
    ll ans=1;
    for(ll i=2;i<=n;i++){
        dp[i]=0;
        for(ll j=1;j<i;j++){
            if(a[j]<a[i]){
                dp[i]+=dp[j];
                dp[i]%=mod;
            }
        }
        ans=(ans+dp[i])%mod;
    }
    cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -