# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
32225 | 2017-10-05T01:00:52 Z | giatuevu | Boat (APIO16_boat) | C++14 | 3 ms | 2032 KB |
#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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 2032 KB | Output is correct |
2 | Correct | 3 ms | 2032 KB | Output is correct |
3 | Correct | 3 ms | 2032 KB | Output is correct |
4 | Correct | 3 ms | 2032 KB | Output is correct |
5 | Correct | 3 ms | 2032 KB | Output is correct |
6 | Correct | 3 ms | 2032 KB | Output is correct |
7 | Correct | 3 ms | 2032 KB | Output is correct |
8 | Correct | 3 ms | 2032 KB | Output is correct |
9 | Correct | 3 ms | 2032 KB | Output is correct |
10 | Correct | 3 ms | 2032 KB | Output is correct |
11 | Correct | 3 ms | 2032 KB | Output is correct |
12 | Correct | 3 ms | 2032 KB | Output is correct |
13 | Correct | 3 ms | 2032 KB | Output is correct |
14 | Correct | 3 ms | 2032 KB | Output is correct |
15 | Correct | 3 ms | 2032 KB | Output is correct |
16 | Correct | 3 ms | 2032 KB | Output is correct |
17 | Correct | 3 ms | 2032 KB | Output is correct |
18 | Correct | 3 ms | 2032 KB | Output is correct |
19 | Correct | 3 ms | 2032 KB | Output is correct |
20 | Correct | 3 ms | 2032 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 2032 KB | Output is correct |
2 | Correct | 3 ms | 2032 KB | Output is correct |
3 | Correct | 3 ms | 2032 KB | Output is correct |
4 | Correct | 3 ms | 2032 KB | Output is correct |
5 | Correct | 3 ms | 2032 KB | Output is correct |
6 | Correct | 3 ms | 2032 KB | Output is correct |
7 | Correct | 3 ms | 2032 KB | Output is correct |
8 | Correct | 3 ms | 2032 KB | Output is correct |
9 | Correct | 3 ms | 2032 KB | Output is correct |
10 | Correct | 3 ms | 2032 KB | Output is correct |
11 | Correct | 3 ms | 2032 KB | Output is correct |
12 | Correct | 3 ms | 2032 KB | Output is correct |
13 | Correct | 3 ms | 2032 KB | Output is correct |
14 | Correct | 3 ms | 2032 KB | Output is correct |
15 | Correct | 3 ms | 2032 KB | Output is correct |
16 | Correct | 3 ms | 2032 KB | Output is correct |
17 | Correct | 3 ms | 2032 KB | Output is correct |
18 | Correct | 3 ms | 2032 KB | Output is correct |
19 | Correct | 3 ms | 2032 KB | Output is correct |
20 | Correct | 3 ms | 2032 KB | Output is correct |
21 | Incorrect | 0 ms | 2032 KB | Output isn't correct |
22 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2032 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 2032 KB | Output is correct |
2 | Correct | 3 ms | 2032 KB | Output is correct |
3 | Correct | 3 ms | 2032 KB | Output is correct |
4 | Correct | 3 ms | 2032 KB | Output is correct |
5 | Correct | 3 ms | 2032 KB | Output is correct |
6 | Correct | 3 ms | 2032 KB | Output is correct |
7 | Correct | 3 ms | 2032 KB | Output is correct |
8 | Correct | 3 ms | 2032 KB | Output is correct |
9 | Correct | 3 ms | 2032 KB | Output is correct |
10 | Correct | 3 ms | 2032 KB | Output is correct |
11 | Correct | 3 ms | 2032 KB | Output is correct |
12 | Correct | 3 ms | 2032 KB | Output is correct |
13 | Correct | 3 ms | 2032 KB | Output is correct |
14 | Correct | 3 ms | 2032 KB | Output is correct |
15 | Correct | 3 ms | 2032 KB | Output is correct |
16 | Correct | 3 ms | 2032 KB | Output is correct |
17 | Correct | 3 ms | 2032 KB | Output is correct |
18 | Correct | 3 ms | 2032 KB | Output is correct |
19 | Correct | 3 ms | 2032 KB | Output is correct |
20 | Correct | 3 ms | 2032 KB | Output is correct |
21 | Incorrect | 0 ms | 2032 KB | Output isn't correct |
22 | Halted | 0 ms | 0 KB | - |