Submission #116048

# Submission time Handle Problem Language Result Execution time Memory
116048 2019-06-10T09:27:25 Z MAMBA Senior Postmen (BOI14_postmen) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h> 

using namespace std;

#define rep(i , j , k) for (int i = j; i < (int)k; i++)
#define pb push_back
typedef vector<int> vi;

constexpr int N = 5e5 + 10;

int n, m, a[N], b[N];
vector<int> adj[N];
int ptr[N];
bitset<N> mark, mark2;

int st[N], R;
void dfs(int v) {
	for (int &id = ptr[v]; id < (int)adj[v].size(); id++) {
		int e = adj[v][id];
		if (!mark[e]) {
			mark[e] = true;
			dfs(a[e] ^ b[e] ^ v);
		}
	}
	if (mark2[v]) {
		while (mark2[v]) {
			printf("%d" , st[R]);
			if (st[R] == v) printf("\n");
			else ptintf(" ");
			mark2[st[R]] = false;
			R--;
		}
	} 
	mark2[v] = true;
	st[++R] = v;

}

int main() {
	scanf("%d%d" , &n , &m);
	rep(i , 0 , m) {
		scanf("%d%d" , a + i , b + i);
		adj[a[i]].pb(i);
		adj[b[i]].pb(i);
	}

	dfs(1);

	return 0;
}

Compilation message

postmen.cpp: In function 'void dfs(int)':
postmen.cpp:30:9: error: 'ptintf' was not declared in this scope
    else ptintf(" ");
         ^~~~~~
postmen.cpp:30:9: note: suggested alternative: 'printf'
    else ptintf(" ");
         ^~~~~~
         printf
postmen.cpp: In function 'int main()':
postmen.cpp:41:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d" , &n , &m);
  ~~~~~^~~~~~~~~~~~~~~~~~
postmen.cpp:43:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d" , a + i , b + i);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~