Submission #210610

# Submission time Handle Problem Language Result Execution time Memory
210610 2020-03-17T20:41:57 Z ZwariowanyMarcin Ronald (COCI17_ronald) C++14
120 / 120
61 ms 6520 KB
#include <bits/stdc++.h>
#define LL long long
#define LD long double
#define pb push_back
#define mp make_pair
#define ss(x) (int) x.size()
#define fi first
#define se second
#define cat(x) cerr << #x << " = " << x << endl
#define rep2(i, j, n) for (LL i = j; i <= n; ++i)
#define rep(i, j, n) for (int i = j; i <= n; ++i)
#define per(i, j, n) for (int i = n; j <= i; --i)
#define boost cin.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(), x.end()
#define bignum vector <int>

using namespace std;

const int N = 1100;

int n, m;
int t[N][N], a, b;
int x[N];

int main() {
	scanf ("%d%d", &n, &m);
	rep(i, 1, m) {
		scanf ("%d%d", &a, &b);
		t[a][b] = 1;
		t[b][a] = 1;
	}
	rep(y, 0, 1) {
		x[1] = y;
		rep(i, 1, n) {
			if (i == 1) continue;
			x[i] = (1 ^ x[1] ^ t[1][i]);
		}
		bool ok = 1;
		rep(i, 1, n) rep(j, 1, n) {
			if (i == j) continue;
			ok &= ((x[i] ^ x[j]) == (1 ^ t[i][j]));
		}
		if (ok) {
			printf ("DA\n");
			return 0;
		}
	}
	printf ("NE");
	
	return 0;
}

Compilation message

ronald.cpp: In function 'int main()':
ronald.cpp:26:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf ("%d%d", &n, &m);
  ~~~~~~^~~~~~~~~~~~~~~~
ronald.cpp:28:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf ("%d%d", &a, &b);
   ~~~~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 4 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 380 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 504 KB Output is correct
3 Correct 5 ms 412 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 508 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 504 KB Output is correct
4 Correct 5 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 632 KB Output is correct
2 Correct 5 ms 632 KB Output is correct
3 Correct 5 ms 760 KB Output is correct
4 Correct 5 ms 760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 1272 KB Output is correct
2 Correct 19 ms 2936 KB Output is correct
3 Correct 10 ms 1784 KB Output is correct
4 Correct 9 ms 1656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 1272 KB Output is correct
2 Correct 15 ms 2808 KB Output is correct
3 Correct 45 ms 5880 KB Output is correct
4 Correct 61 ms 6520 KB Output is correct