답안 #718337

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
718337 2023-04-04T00:19:01 Z irmuun Boat (APIO16_boat) C++17
컴파일 오류
0 ms 0 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 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;
}

Compilation message

boat.cpp:11:7: error: 'mod' does not name a type; did you mean 'modf'?
   11 | const mod=1e9+7;
      |       ^~~
      |       modf
boat.cpp: In function 'int main()':
boat.cpp:28:24: error: 'mod' was not declared in this scope; did you mean 'modf'?
   28 |                 dp[i]%=mod;
      |                        ^~~
      |                        modf
boat.cpp:31:25: error: 'mod' was not declared in this scope; did you mean 'modf'?
   31 |         ans=(ans+dp[i])%mod;
      |                         ^~~
      |                         modf