제출 #68529

#제출 시각아이디문제언어결과실행 시간메모리
68529KLPPBoat (APIO16_boat)C++14
0 / 100
3 ms504 KiB
#include<iostream>
#include<stdio.h>

using namespace std;
typedef long long int lld;
#define MOD 1000000007

int main(){
	int n;
	cin>>n;
	pair<int,int> arr[n];
	for(int i=0;i<n;i++)cin>>arr[i].first>>arr[i].second;
	lld DP[n];
	lld ans=0;
	for(int i=0;i<n;i++){
		DP[i]=1;
		for(int j=0;j<i;j++){
			if(arr[j].first<arr[i].first){
				DP[i]+=DP[j];
				DP[i]%=MOD;
			}
		}
		ans+=DP[i];
	}
	cout<<ans<<endl;
	
	return 0;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…