답안 #875945

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
875945 2023-11-20T20:23:06 Z Lobo Boat (APIO16_boat) C++17
9 / 100
2000 ms 292032 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fr first
#define sc second

const int mod = 1e9+7;

int n;

int32_t main() {
	cin >> n;

	map<int,int> dp;
	dp[0] = 1;
	for(int i = 1; i <= n; i++) {
		int a,b; cin >> a >> b;
		int sum = 0;
		for(auto X : dp) {
			if(X.fr >= a) continue;
			sum+= X.sc;
			sum%= mod;
		}

		for(int j = a; j <= b; j++) {
			sum+= dp[j];
			sum%= mod;
			dp[j] = sum;
		}
	}

	int ans = 0;
	for(auto x : dp) {
		if(x.fr != 0) {
			ans+= x.sc;
			ans%= mod;
		}
	}

	cout << ans << endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 444 KB Output is correct
9 Correct 1 ms 436 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 444 KB Output is correct
9 Correct 1 ms 436 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 90 ms 600 KB Output is correct
22 Correct 96 ms 600 KB Output is correct
23 Correct 89 ms 752 KB Output is correct
24 Correct 99 ms 600 KB Output is correct
25 Correct 100 ms 852 KB Output is correct
26 Correct 94 ms 592 KB Output is correct
27 Correct 97 ms 600 KB Output is correct
28 Correct 98 ms 604 KB Output is correct
29 Correct 99 ms 848 KB Output is correct
30 Execution timed out 2040 ms 37860 KB Time limit exceeded
31 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2063 ms 292032 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 444 KB Output is correct
9 Correct 1 ms 436 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 90 ms 600 KB Output is correct
22 Correct 96 ms 600 KB Output is correct
23 Correct 89 ms 752 KB Output is correct
24 Correct 99 ms 600 KB Output is correct
25 Correct 100 ms 852 KB Output is correct
26 Correct 94 ms 592 KB Output is correct
27 Correct 97 ms 600 KB Output is correct
28 Correct 98 ms 604 KB Output is correct
29 Correct 99 ms 848 KB Output is correct
30 Execution timed out 2040 ms 37860 KB Time limit exceeded
31 Halted 0 ms 0 KB -