Submission #3004942


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int n,m; bitset<400> S[400];
int x[200005], y[200005];
bool no[200005];

int main() {
	scanf("%d%d", &n, &m);
	for (int i=0; i<n; i++) S[i][i] = 1;
	for (int i=0; i<m; i++) scanf("%d%d", &x[i], &y[i]), --x[i], --y[i];
	for (int i=m-1; i>=0; i--) {
		for (int j=0; j<n; j++) {
			if (S[j][x[i]] && S[j][y[i]]) no[j] = 1;
			else if (S[j][x[i]]) S[j][y[i]] = 1;
			else if (S[j][y[i]]) S[j][x[i]] = 1;
		}
	}
	int ans = 0;
	for (int i=0; i<n-1; i++)
		for (int j=i+1; j<n; j++)
			if (!no[i] && !no[j] && !(S[i] & S[j]).count()) {
				++ans;
			}
	printf("%d\n", ans);
	return 0;
}
 

Submission Info

Submission Time
Task F - NRE
User vjudge4
Language C++14 (GCC 5.4.1)
Score 0
Code Size 628 Byte
Status RE
Exec Time 103 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &n, &m);
                       ^
./Main.cpp:11:69: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  for (int i=0; i<m; i++) scanf("%d%d", &x[i], &y[i]), --x[i], --y[i];
                                                                     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 1000
Status
WA × 3
RE × 4
AC × 1
WA × 11
RE × 115
Set Name Test Cases
Sample example_0, example_1, example_2, example_3, example_4, example_5, example_6
All cent_0, cent_1, cent_2, cent_3, cent_4, cent_5, cent_6, cent_7, cent_8, cent_9, example_0, example_1, example_2, example_3, example_4, example_5, example_6, full_0, full_1, full_10, full_11, full_12, full_13, full_14, full_15, full_16, full_17, full_18, full_19, full_2, full_3, full_4, full_5, full_6, full_7, full_8, full_9, maxrand_0, maxrand_1, maxrand_10, maxrand_11, maxrand_12, maxrand_13, maxrand_14, maxrand_15, maxrand_16, maxrand_17, maxrand_18, maxrand_19, maxrand_2, maxrand_20, maxrand_21, maxrand_22, maxrand_23, maxrand_24, maxrand_25, maxrand_26, maxrand_27, maxrand_28, maxrand_29, maxrand_3, maxrand_4, maxrand_5, maxrand_6, maxrand_7, maxrand_8, maxrand_9, rand_0, rand_1, rand_10, rand_11, rand_12, rand_13, rand_14, rand_15, rand_16, rand_17, rand_18, rand_19, rand_2, rand_3, rand_4, rand_5, rand_6, rand_7, rand_8, rand_9, small_0, small_1, small_2, small_3, small_4, small_5, small_6, small_7, small_8, small_9, smallwidth_0, smallwidth_1, smallwidth_10, smallwidth_11, smallwidth_12, smallwidth_13, smallwidth_14, smallwidth_15, smallwidth_16, smallwidth_17, smallwidth_18, smallwidth_19, smallwidth_2, smallwidth_20, smallwidth_21, smallwidth_22, smallwidth_23, smallwidth_24, smallwidth_25, smallwidth_26, smallwidth_27, smallwidth_28, smallwidth_29, smallwidth_3, smallwidth_4, smallwidth_5, smallwidth_6, smallwidth_7, smallwidth_8, smallwidth_9
Case Name Status Exec Time Memory
cent_0 RE 97 ms 256 KB
cent_1 RE 97 ms 256 KB
cent_2 RE 97 ms 256 KB
cent_3 RE 97 ms 256 KB
cent_4 RE 98 ms 256 KB
cent_5 RE 97 ms 256 KB
cent_6 RE 96 ms 256 KB
cent_7 RE 98 ms 256 KB
cent_8 RE 98 ms 256 KB
cent_9 RE 97 ms 256 KB
example_0 RE 97 ms 256 KB
example_1 RE 97 ms 256 KB
example_2 RE 97 ms 256 KB
example_3 WA 1 ms 256 KB
example_4 WA 1 ms 256 KB
example_5 RE 98 ms 256 KB
example_6 WA 1 ms 256 KB
full_0 RE 98 ms 256 KB
full_1 RE 97 ms 256 KB
full_10 RE 97 ms 256 KB
full_11 RE 98 ms 256 KB
full_12 RE 97 ms 256 KB
full_13 RE 97 ms 256 KB
full_14 RE 98 ms 256 KB
full_15 RE 97 ms 256 KB
full_16 RE 98 ms 256 KB
full_17 RE 97 ms 256 KB
full_18 RE 97 ms 256 KB
full_19 RE 97 ms 256 KB
full_2 RE 97 ms 256 KB
full_3 RE 97 ms 256 KB
full_4 RE 100 ms 256 KB
full_5 RE 98 ms 256 KB
full_6 RE 97 ms 256 KB
full_7 RE 98 ms 256 KB
full_8 RE 97 ms 256 KB
full_9 RE 98 ms 256 KB
maxrand_0 RE 97 ms 256 KB
maxrand_1 RE 97 ms 256 KB
maxrand_10 RE 97 ms 256 KB
maxrand_11 RE 99 ms 256 KB
maxrand_12 RE 96 ms 256 KB
maxrand_13 RE 97 ms 256 KB
maxrand_14 RE 98 ms 256 KB
maxrand_15 RE 97 ms 256 KB
maxrand_16 RE 97 ms 256 KB
maxrand_17 RE 97 ms 256 KB
maxrand_18 RE 97 ms 256 KB
maxrand_19 RE 97 ms 256 KB
maxrand_2 RE 102 ms 256 KB
maxrand_20 RE 103 ms 256 KB
maxrand_21 RE 97 ms 256 KB
maxrand_22 RE 97 ms 256 KB
maxrand_23 RE 98 ms 256 KB
maxrand_24 RE 97 ms 256 KB
maxrand_25 RE 98 ms 256 KB
maxrand_26 RE 97 ms 256 KB
maxrand_27 RE 97 ms 256 KB
maxrand_28 RE 97 ms 256 KB
maxrand_29 RE 98 ms 256 KB
maxrand_3 RE 97 ms 256 KB
maxrand_4 RE 98 ms 256 KB
maxrand_5 RE 97 ms 256 KB
maxrand_6 RE 97 ms 256 KB
maxrand_7 RE 97 ms 256 KB
maxrand_8 RE 98 ms 256 KB
maxrand_9 RE 97 ms 256 KB
rand_0 RE 97 ms 256 KB
rand_1 RE 97 ms 256 KB
rand_10 RE 97 ms 256 KB
rand_11 RE 98 ms 256 KB
rand_12 RE 97 ms 256 KB
rand_13 RE 97 ms 256 KB
rand_14 RE 97 ms 256 KB
rand_15 RE 96 ms 256 KB
rand_16 RE 97 ms 256 KB
rand_17 RE 98 ms 256 KB
rand_18 RE 97 ms 256 KB
rand_19 RE 97 ms 256 KB
rand_2 RE 98 ms 256 KB
rand_3 RE 97 ms 256 KB
rand_4 RE 97 ms 256 KB
rand_5 RE 97 ms 256 KB
rand_6 RE 99 ms 256 KB
rand_7 RE 101 ms 256 KB
rand_8 RE 97 ms 256 KB
rand_9 RE 97 ms 256 KB
small_0 WA 1 ms 256 KB
small_1 WA 1 ms 256 KB
small_2 WA 1 ms 256 KB
small_3 WA 1 ms 256 KB
small_4 RE 97 ms 256 KB
small_5 WA 1 ms 256 KB
small_6 WA 1 ms 256 KB
small_7 WA 1 ms 256 KB
small_8 WA 1 ms 256 KB
small_9 AC 1 ms 256 KB
smallwidth_0 RE 97 ms 256 KB
smallwidth_1 RE 97 ms 256 KB
smallwidth_10 RE 97 ms 256 KB
smallwidth_11 RE 97 ms 256 KB
smallwidth_12 RE 97 ms 256 KB
smallwidth_13 RE 97 ms 256 KB
smallwidth_14 RE 98 ms 256 KB
smallwidth_15 RE 98 ms 256 KB
smallwidth_16 RE 97 ms 256 KB
smallwidth_17 RE 97 ms 256 KB
smallwidth_18 RE 97 ms 256 KB
smallwidth_19 RE 97 ms 256 KB
smallwidth_2 RE 97 ms 256 KB
smallwidth_20 RE 97 ms 256 KB
smallwidth_21 RE 97 ms 256 KB
smallwidth_22 RE 97 ms 256 KB
smallwidth_23 RE 96 ms 256 KB
smallwidth_24 RE 97 ms 256 KB
smallwidth_25 RE 97 ms 256 KB
smallwidth_26 RE 97 ms 256 KB
smallwidth_27 RE 97 ms 256 KB
smallwidth_28 RE 97 ms 256 KB
smallwidth_29 RE 97 ms 256 KB
smallwidth_3 RE 97 ms 256 KB
smallwidth_4 RE 97 ms 256 KB
smallwidth_5 RE 96 ms 256 KB
smallwidth_6 RE 97 ms 256 KB
smallwidth_7 RE 97 ms 256 KB
smallwidth_8 RE 97 ms 256 KB
smallwidth_9 RE 97 ms 256 KB