Submission #32225

#TimeUsernameProblemLanguageResultExecution timeMemory
32225giatuevuBoat (APIO16_boat)C++14
9 / 100
3 ms2032 KiB
#include <bits/stdc++.h>
using namespace std;
typedef pair <long long,long long> ll;
ll a[505];
long long n,f[505][2],mod=1e9+7,kq;
bool check1,check2,check3;
void sub1()
{
    for (int i=1; i<=n; ++i)
    {
        long long pos=1,pos2=1;
                for (int j=1; j<i; ++j)
        {
            f[i][0]=(f[i][0]+f[j][1])%mod;
            if (a[i].first>a[j].first) f[i][1]=(f[i][1]+f[j][1])%mod;
        }
        f[i][1]++;
    }
    cout<<(f[n][0]+f[n][1])%mod;
}
int main()
{
    cin>>n;
    check1=check2=check3=true;
    for (int i=1; i<=n; ++i)
    {
        cin>>a[i].first>>a[i].second;
        if (a[i].first!=a[i].second) check1=false;
    }
    if (check1==true) sub1();
}

Compilation message (stderr)

boat.cpp: In function 'void sub1()':
boat.cpp:11:19: warning: unused variable 'pos' [-Wunused-variable]
         long long pos=1,pos2=1;
                   ^
boat.cpp:11:25: warning: unused variable 'pos2' [-Wunused-variable]
         long long pos=1,pos2=1;
                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...