Submission #20346

# Submission time Handle Problem Language Result Execution time Memory
20346 2017-02-07T07:12:20 Z 초음속철도 (OJUZ11_rail) C++
10 / 100
144 ms 396 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<lint, lint> pi;

int n, m, s[22], e[22];

int main(){
	cin >> n >> m;
	for(int i=0; i<m; i++){
		cin >>s[i]>>e[i];
	}
	if(n > 20 || m > 20){
		puts("0");
		return 0;
	}
	if(n == 1) assert(0);
	int ans = 0;
	for(int i=0; i<(1<<m); i++){
		int dx[22] = {};
		int ok = 1;
		for(int j=0; j<m; j++){
			if((i >> j) & 1){
				dx[s[j]]++;
				dx[e[j]]--;
			}
		}
		for(int i=1; i<n; i++){
			dx[i] += dx[i-1];
			if(!dx[i]) ok = 0;
		}
		if(ok) ans++;
	}
	cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 103 ms 288 KB Output is correct
2 Correct 144 ms 312 KB Output is correct
3 Correct 126 ms 312 KB Output is correct
4 Correct 2 ms 312 KB Output is correct
5 Correct 2 ms 312 KB Output is correct
6 Correct 109 ms 316 KB Output is correct
7 Correct 19 ms 316 KB Output is correct
8 Correct 2 ms 316 KB Output is correct
9 Correct 2 ms 316 KB Output is correct
10 Correct 67 ms 316 KB Output is correct
11 Correct 138 ms 380 KB Output is correct
12 Correct 53 ms 380 KB Output is correct
13 Correct 119 ms 380 KB Output is correct
14 Correct 128 ms 380 KB Output is correct
15 Correct 115 ms 380 KB Output is correct
16 Correct 125 ms 380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 103 ms 288 KB Output is correct
2 Correct 144 ms 312 KB Output is correct
3 Correct 126 ms 312 KB Output is correct
4 Correct 2 ms 312 KB Output is correct
5 Correct 2 ms 312 KB Output is correct
6 Correct 109 ms 316 KB Output is correct
7 Correct 19 ms 316 KB Output is correct
8 Correct 2 ms 316 KB Output is correct
9 Correct 2 ms 316 KB Output is correct
10 Correct 67 ms 316 KB Output is correct
11 Correct 138 ms 380 KB Output is correct
12 Correct 53 ms 380 KB Output is correct
13 Correct 119 ms 380 KB Output is correct
14 Correct 128 ms 380 KB Output is correct
15 Correct 115 ms 380 KB Output is correct
16 Correct 125 ms 380 KB Output is correct
17 Incorrect 2 ms 380 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 1 ms 380 KB Output is correct
3 Correct 1 ms 380 KB Output is correct
4 Runtime error 2 ms 396 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# Verdict Execution time Memory Grader output
1 Correct 103 ms 288 KB Output is correct
2 Correct 144 ms 312 KB Output is correct
3 Correct 126 ms 312 KB Output is correct
4 Correct 2 ms 312 KB Output is correct
5 Correct 2 ms 312 KB Output is correct
6 Correct 109 ms 316 KB Output is correct
7 Correct 19 ms 316 KB Output is correct
8 Correct 2 ms 316 KB Output is correct
9 Correct 2 ms 316 KB Output is correct
10 Correct 67 ms 316 KB Output is correct
11 Correct 138 ms 380 KB Output is correct
12 Correct 53 ms 380 KB Output is correct
13 Correct 119 ms 380 KB Output is correct
14 Correct 128 ms 380 KB Output is correct
15 Correct 115 ms 380 KB Output is correct
16 Correct 125 ms 380 KB Output is correct
17 Incorrect 2 ms 380 KB -
# Verdict Execution time Memory Grader output
1 Correct 103 ms 288 KB Output is correct
2 Correct 144 ms 312 KB Output is correct
3 Correct 126 ms 312 KB Output is correct
4 Correct 2 ms 312 KB Output is correct
5 Correct 2 ms 312 KB Output is correct
6 Correct 109 ms 316 KB Output is correct
7 Correct 19 ms 316 KB Output is correct
8 Correct 2 ms 316 KB Output is correct
9 Correct 2 ms 316 KB Output is correct
10 Correct 67 ms 316 KB Output is correct
11 Correct 138 ms 380 KB Output is correct
12 Correct 53 ms 380 KB Output is correct
13 Correct 119 ms 380 KB Output is correct
14 Correct 128 ms 380 KB Output is correct
15 Correct 115 ms 380 KB Output is correct
16 Correct 125 ms 380 KB Output is correct
17 Incorrect 2 ms 380 KB -