# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
20364 | 2017-02-07T08:32:25 Z | 초음속철도 (OJUZ11_rail) | C++ | 247 ms | 197968 KB |
#include<bits/stdc++.h> using namespace std; typedef long long lint; typedef long double llf; typedef pair<int, int> pi; const int mod = 1e9 + 7; int n, m; int dp[5005][10005]; pi a[5005]; vector<int> v; int main(){ scanf("%d %d",&n,&m); v.push_back(1); v.push_back(n); for(int i=0; i<m; i++){ scanf("%d %d",&a[i].first,&a[i].second); v.push_back(a[i].first); v.push_back(a[i].second); } sort(v.begin(), v.end()); v.resize(unique(v.begin(), v.end()) - v.begin()); for(int i=0; i<m; i++){ a[i].first = lower_bound(v.begin(), v.end(), a[i].first) - v.begin(); a[i].second = lower_bound(v.begin(), v.end(), a[i].second) - v.begin(); } sort(a, a+m); dp[m][v.size()-1] = 1; for(int i=m-1; i>=0; i--){ for(int j=0; j<v.size(); j++){ if(j < a[i].first) dp[i][j] = dp[i+1][j]; else if(j < a[i].second) dp[i][j] = dp[i+1][j] + dp[i+1][a[i].second]; else dp[i][j] = 2 * dp[i+1][j]; dp[i][j] %= mod; } } cout << dp[0][0]; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 400 KB | Output is correct |
2 | Correct | 2 ms | 440 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 2 ms | 464 KB | Output is correct |
5 | Correct | 2 ms | 464 KB | Output is correct |
6 | Correct | 2 ms | 464 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 2 ms | 464 KB | Output is correct |
9 | Correct | 2 ms | 464 KB | Output is correct |
10 | Correct | 2 ms | 464 KB | Output is correct |
11 | Correct | 2 ms | 464 KB | Output is correct |
12 | Correct | 2 ms | 464 KB | Output is correct |
13 | Correct | 2 ms | 464 KB | Output is correct |
14 | Correct | 2 ms | 464 KB | Output is correct |
15 | Correct | 2 ms | 464 KB | Output is correct |
16 | Correct | 2 ms | 464 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 400 KB | Output is correct |
2 | Correct | 2 ms | 440 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 2 ms | 464 KB | Output is correct |
5 | Correct | 2 ms | 464 KB | Output is correct |
6 | Correct | 2 ms | 464 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 2 ms | 464 KB | Output is correct |
9 | Correct | 2 ms | 464 KB | Output is correct |
10 | Correct | 2 ms | 464 KB | Output is correct |
11 | Correct | 2 ms | 464 KB | Output is correct |
12 | Correct | 2 ms | 464 KB | Output is correct |
13 | Correct | 2 ms | 464 KB | Output is correct |
14 | Correct | 2 ms | 464 KB | Output is correct |
15 | Correct | 2 ms | 464 KB | Output is correct |
16 | Correct | 2 ms | 464 KB | Output is correct |
17 | Correct | 2 ms | 464 KB | Output is correct |
18 | Correct | 2 ms | 464 KB | Output is correct |
19 | Correct | 2 ms | 464 KB | Output is correct |
20 | Correct | 2 ms | 464 KB | Output is correct |
21 | Correct | 2 ms | 464 KB | Output is correct |
22 | Correct | 2 ms | 464 KB | Output is correct |
23 | Correct | 2 ms | 464 KB | Output is correct |
24 | Correct | 2 ms | 464 KB | Output is correct |
25 | Correct | 2 ms | 464 KB | Output is correct |
26 | Correct | 2 ms | 464 KB | Output is correct |
27 | Correct | 2 ms | 464 KB | Output is correct |
28 | Correct | 2 ms | 464 KB | Output is correct |
29 | Correct | 2 ms | 464 KB | Output is correct |
30 | Correct | 2 ms | 464 KB | Output is correct |
31 | Correct | 2 ms | 464 KB | Output is correct |
32 | Correct | 2 ms | 464 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 464 KB | Output is correct |
2 | Correct | 2 ms | 464 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 50 ms | 47376 KB | Output is correct |
5 | Runtime error | 127 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
6 | Runtime error | 208 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
7 | Runtime error | 199 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
8 | Correct | 2 ms | 47376 KB | Output is correct |
9 | Runtime error | 194 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
10 | Runtime error | 200 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
11 | Runtime error | 72 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
12 | Runtime error | 208 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
13 | Runtime error | 214 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
14 | Runtime error | 84 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
15 | Runtime error | 78 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
16 | Runtime error | 213 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
17 | Runtime error | 193 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
18 | Runtime error | 246 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 400 KB | Output is correct |
2 | Correct | 2 ms | 440 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 2 ms | 464 KB | Output is correct |
5 | Correct | 2 ms | 464 KB | Output is correct |
6 | Correct | 2 ms | 464 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 2 ms | 464 KB | Output is correct |
9 | Correct | 2 ms | 464 KB | Output is correct |
10 | Correct | 2 ms | 464 KB | Output is correct |
11 | Correct | 2 ms | 464 KB | Output is correct |
12 | Correct | 2 ms | 464 KB | Output is correct |
13 | Correct | 2 ms | 464 KB | Output is correct |
14 | Correct | 2 ms | 464 KB | Output is correct |
15 | Correct | 2 ms | 464 KB | Output is correct |
16 | Correct | 2 ms | 464 KB | Output is correct |
17 | Correct | 2 ms | 464 KB | Output is correct |
18 | Correct | 2 ms | 464 KB | Output is correct |
19 | Correct | 2 ms | 464 KB | Output is correct |
20 | Correct | 2 ms | 464 KB | Output is correct |
21 | Correct | 2 ms | 464 KB | Output is correct |
22 | Correct | 2 ms | 464 KB | Output is correct |
23 | Correct | 2 ms | 464 KB | Output is correct |
24 | Correct | 2 ms | 464 KB | Output is correct |
25 | Correct | 2 ms | 464 KB | Output is correct |
26 | Correct | 2 ms | 464 KB | Output is correct |
27 | Correct | 2 ms | 464 KB | Output is correct |
28 | Correct | 2 ms | 464 KB | Output is correct |
29 | Correct | 2 ms | 464 KB | Output is correct |
30 | Correct | 2 ms | 464 KB | Output is correct |
31 | Correct | 2 ms | 464 KB | Output is correct |
32 | Correct | 2 ms | 464 KB | Output is correct |
33 | Correct | 238 ms | 197968 KB | Output is correct |
34 | Correct | 175 ms | 197968 KB | Output is correct |
35 | Correct | 83 ms | 197968 KB | Output is correct |
36 | Correct | 16 ms | 197968 KB | Output is correct |
37 | Correct | 240 ms | 197968 KB | Output is correct |
38 | Correct | 247 ms | 197968 KB | Output is correct |
39 | Correct | 2 ms | 197968 KB | Output is correct |
40 | Correct | 176 ms | 197968 KB | Output is correct |
41 | Correct | 16 ms | 197968 KB | Output is correct |
42 | Correct | 134 ms | 197968 KB | Output is correct |
43 | Correct | 129 ms | 197968 KB | Output is correct |
44 | Correct | 128 ms | 197968 KB | Output is correct |
45 | Correct | 18 ms | 197968 KB | Output is correct |
46 | Correct | 17 ms | 197968 KB | Output is correct |
47 | Correct | 20 ms | 197968 KB | Output is correct |
48 | Correct | 16 ms | 197968 KB | Output is correct |
49 | Correct | 227 ms | 197968 KB | Output is correct |
50 | Correct | 51 ms | 197968 KB | Output is correct |
51 | Correct | 235 ms | 197968 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 400 KB | Output is correct |
2 | Correct | 2 ms | 440 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 2 ms | 464 KB | Output is correct |
5 | Correct | 2 ms | 464 KB | Output is correct |
6 | Correct | 2 ms | 464 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 2 ms | 464 KB | Output is correct |
9 | Correct | 2 ms | 464 KB | Output is correct |
10 | Correct | 2 ms | 464 KB | Output is correct |
11 | Correct | 2 ms | 464 KB | Output is correct |
12 | Correct | 2 ms | 464 KB | Output is correct |
13 | Correct | 2 ms | 464 KB | Output is correct |
14 | Correct | 2 ms | 464 KB | Output is correct |
15 | Correct | 2 ms | 464 KB | Output is correct |
16 | Correct | 2 ms | 464 KB | Output is correct |
17 | Correct | 2 ms | 464 KB | Output is correct |
18 | Correct | 2 ms | 464 KB | Output is correct |
19 | Correct | 2 ms | 464 KB | Output is correct |
20 | Correct | 2 ms | 464 KB | Output is correct |
21 | Correct | 2 ms | 464 KB | Output is correct |
22 | Correct | 2 ms | 464 KB | Output is correct |
23 | Correct | 2 ms | 464 KB | Output is correct |
24 | Correct | 2 ms | 464 KB | Output is correct |
25 | Correct | 2 ms | 464 KB | Output is correct |
26 | Correct | 2 ms | 464 KB | Output is correct |
27 | Correct | 2 ms | 464 KB | Output is correct |
28 | Correct | 2 ms | 464 KB | Output is correct |
29 | Correct | 2 ms | 464 KB | Output is correct |
30 | Correct | 2 ms | 464 KB | Output is correct |
31 | Correct | 2 ms | 464 KB | Output is correct |
32 | Correct | 2 ms | 464 KB | Output is correct |
33 | Correct | 2 ms | 464 KB | Output is correct |
34 | Correct | 2 ms | 464 KB | Output is correct |
35 | Correct | 2 ms | 464 KB | Output is correct |
36 | Correct | 50 ms | 47376 KB | Output is correct |
37 | Runtime error | 127 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
38 | Runtime error | 208 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
39 | Runtime error | 199 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
40 | Correct | 2 ms | 47376 KB | Output is correct |
41 | Runtime error | 194 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
42 | Runtime error | 200 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
43 | Runtime error | 72 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
44 | Runtime error | 208 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
45 | Runtime error | 214 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
46 | Runtime error | 84 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
47 | Runtime error | 78 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
48 | Runtime error | 213 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
49 | Runtime error | 193 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
50 | Runtime error | 246 ms | 47376 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
51 | Correct | 238 ms | 197968 KB | Output is correct |
52 | Correct | 175 ms | 197968 KB | Output is correct |
53 | Correct | 83 ms | 197968 KB | Output is correct |
54 | Correct | 16 ms | 197968 KB | Output is correct |
55 | Correct | 240 ms | 197968 KB | Output is correct |
56 | Correct | 247 ms | 197968 KB | Output is correct |
57 | Correct | 2 ms | 197968 KB | Output is correct |
58 | Correct | 176 ms | 197968 KB | Output is correct |
59 | Correct | 16 ms | 197968 KB | Output is correct |
60 | Correct | 134 ms | 197968 KB | Output is correct |
61 | Correct | 129 ms | 197968 KB | Output is correct |
62 | Correct | 128 ms | 197968 KB | Output is correct |
63 | Correct | 18 ms | 197968 KB | Output is correct |
64 | Correct | 17 ms | 197968 KB | Output is correct |
65 | Correct | 20 ms | 197968 KB | Output is correct |
66 | Correct | 16 ms | 197968 KB | Output is correct |
67 | Correct | 227 ms | 197968 KB | Output is correct |
68 | Correct | 51 ms | 197968 KB | Output is correct |
69 | Correct | 235 ms | 197968 KB | Output is correct |
70 | Runtime error | 225 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
71 | Runtime error | 143 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
72 | Runtime error | 127 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
73 | Runtime error | 72 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
74 | Runtime error | 193 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
75 | Runtime error | 213 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
76 | Correct | 117 ms | 197968 KB | Output is correct |
77 | Runtime error | 190 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
78 | Runtime error | 72 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
79 | Runtime error | 191 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
80 | Runtime error | 214 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
81 | Runtime error | 218 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
82 | Runtime error | 120 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
83 | Runtime error | 111 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
84 | Runtime error | 212 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
85 | Runtime error | 206 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
86 | Runtime error | 220 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
87 | Runtime error | 195 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
88 | Runtime error | 204 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
89 | Runtime error | 205 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
90 | Runtime error | 206 ms | 197968 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |