# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
494885 | 2021-12-17T08:02:00 Z | BreakOfDawn | Boat (APIO16_boat) | C++14 | 2 ms | 332 KB |
/* You are watching a brute force code CODE IS WRITTEN BY 13MINUSONE */ #include<bits/stdc++.h> using namespace std; #define task "DUT03TEAMS" #define SZ(c) c.size() #define getbit(x,i) (((x) >> (i)) & 1) #define turnoff(x,i) (x)&(~(1<<(i))) #define mu2(x) (1<<x) #define __builtin_popcount __builtin_popcountll #define all(x) x.begin(),x.end() #define endl '\n' #define fi first #define se second typedef long long ll ; typedef pair<int,int> ii; typedef vector<ll> vll; typedef vector<int> vi; template<class X, class Y> bool minimize(X &x, const Y &y) { X eps = 1e-9; if (x > y + eps) { x = y; return true; } else return false; } template<class X, class Y> bool maximize(X &x, const Y &y) { X eps = 1e-9; if (x + eps < y) { x = y; return true; } else return false; } template<class T> T Abs(const T &x) { return (x < 0 ? -x : x); } const ll N = 505 + 5; const ll mod =1e9+7; const ll base = 311; const int block = 488; void fastio() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } void inti() { if(fopen(task".inp","r")) { freopen(task".inp","r",stdin); freopen(task".out","w",stdout); } } int n, mx; int dp[N]; int a[N], b[N]; void nhap() { cin >> n; for(int i = 1; i <= n; ++i) { cin >> a[i] >> b[i]; } dp[0] = 1; for(int i = 1; i <= n; ++i) { for(int j = i - 1; j >= 0; --j) { if(a[j] < a[i]) { dp[i] = (dp[i] + dp[j]) % mod; } } } int sum = 0; for(int i = 1; i <= n; ++i) { sum = (sum + dp[i]) % mod; } cout << sum; } int main() { fastio(); inti(); nhap(); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 328 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 312 KB | Output is correct |
5 | Correct | 1 ms | 328 KB | Output is correct |
6 | Correct | 2 ms | 332 KB | Output is correct |
7 | Correct | 2 ms | 332 KB | Output is correct |
8 | Correct | 1 ms | 332 KB | Output is correct |
9 | Correct | 2 ms | 332 KB | Output is correct |
10 | Correct | 1 ms | 332 KB | Output is correct |
11 | Correct | 1 ms | 332 KB | Output is correct |
12 | Correct | 2 ms | 332 KB | Output is correct |
13 | Correct | 1 ms | 332 KB | Output is correct |
14 | Correct | 2 ms | 332 KB | Output is correct |
15 | Correct | 1 ms | 332 KB | Output is correct |
16 | Correct | 1 ms | 204 KB | Output is correct |
17 | Correct | 1 ms | 328 KB | Output is correct |
18 | Correct | 1 ms | 332 KB | Output is correct |
19 | Correct | 1 ms | 332 KB | Output is correct |
20 | Correct | 1 ms | 332 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 328 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 312 KB | Output is correct |
5 | Correct | 1 ms | 328 KB | Output is correct |
6 | Correct | 2 ms | 332 KB | Output is correct |
7 | Correct | 2 ms | 332 KB | Output is correct |
8 | Correct | 1 ms | 332 KB | Output is correct |
9 | Correct | 2 ms | 332 KB | Output is correct |
10 | Correct | 1 ms | 332 KB | Output is correct |
11 | Correct | 1 ms | 332 KB | Output is correct |
12 | Correct | 2 ms | 332 KB | Output is correct |
13 | Correct | 1 ms | 332 KB | Output is correct |
14 | Correct | 2 ms | 332 KB | Output is correct |
15 | Correct | 1 ms | 332 KB | Output is correct |
16 | Correct | 1 ms | 204 KB | Output is correct |
17 | Correct | 1 ms | 328 KB | Output is correct |
18 | Correct | 1 ms | 332 KB | Output is correct |
19 | Correct | 1 ms | 332 KB | Output is correct |
20 | Correct | 1 ms | 332 KB | Output is correct |
21 | Incorrect | 1 ms | 208 KB | Output isn't correct |
22 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 320 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 328 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 312 KB | Output is correct |
5 | Correct | 1 ms | 328 KB | Output is correct |
6 | Correct | 2 ms | 332 KB | Output is correct |
7 | Correct | 2 ms | 332 KB | Output is correct |
8 | Correct | 1 ms | 332 KB | Output is correct |
9 | Correct | 2 ms | 332 KB | Output is correct |
10 | Correct | 1 ms | 332 KB | Output is correct |
11 | Correct | 1 ms | 332 KB | Output is correct |
12 | Correct | 2 ms | 332 KB | Output is correct |
13 | Correct | 1 ms | 332 KB | Output is correct |
14 | Correct | 2 ms | 332 KB | Output is correct |
15 | Correct | 1 ms | 332 KB | Output is correct |
16 | Correct | 1 ms | 204 KB | Output is correct |
17 | Correct | 1 ms | 328 KB | Output is correct |
18 | Correct | 1 ms | 332 KB | Output is correct |
19 | Correct | 1 ms | 332 KB | Output is correct |
20 | Correct | 1 ms | 332 KB | Output is correct |
21 | Incorrect | 1 ms | 208 KB | Output isn't correct |
22 | Halted | 0 ms | 0 KB | - |