Пример #1
0
//Uva10768
int main(int argc, char const *argv[])
{
	while (~scanf("%d%d", &n, &m)) {
		memset(mat, 0, sizeof(mat));
		for (int i = 0; i < m; i++) {
			int a, b;
			scanf("%d%d", &a, &b);
			if (a == b) continue;
			mat[a][b] = mat[b][a] = true;
		}
		printf("%s\n", planarity() ? "YES" : "NO");
	}
	return 0;
}
Пример #2
0
PyObject *wrap_planarity(PyObject *self,PyObject *args)
{

  PyObject *cs;
  if(!PyArg_ParseTuple(args,"O",&cs))
    return NULL;
  int natoms = PySequence_Length(cs);
  rvec x[natoms];

  PyObject2rvec( cs, x, natoms);

  real p = planarity(x, natoms);
  PyObject *ret;
  ret = Py_BuildValue("d",p);
  return ret;
}