# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
32225 | giatuevu | Boat (APIO16_boat) | C++14 | 3 ms | 2032 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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();
}
컴파일 시 표준 에러 (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... |