Submission #130410

# Submission time Handle Problem Language Result Execution time Memory
130410 2019-07-15T07:03:13 Z 이온조(#3149) Information (CEOI08_information) C++14
46 / 100
200 ms 9464 KB
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;

vector<int> A1, A2;
vector<pii> adj[2009];
bool v1[2009], v2[2009];
bool chk[1000009];

void dfs(vector<int> &S, bool c[], bool v[], int x) {
	v[x] = 1;
	for(auto& it: adj[x]) {
		if(!c[it.second] && !v[it.first]) {
			c[it.second] = 1;
			S.push_back(it.second);
			dfs(S, c, v, it.first);
		}
	}
}

int main() {
	int N, M; scanf("%d%d",&N,&M);
	for(int i=1; i<=M; i++) {
		int u, v; scanf("%d%d",&u,&v);
		adj[u].push_back({v, i});
	}
	dfs(A1, chk, v1, 1);
	dfs(A2, chk, v2, 1);
	if((int)A1.size() != N-1 || (int)A2.size() != N-1) return !printf("NONE");
	for(auto& it: A1) printf("%d ", it); puts("");
	for(auto& it: A2) printf("%d ", it);
	return 0;
}

Compilation message

information.cpp: In function 'int main()':
information.cpp:30:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for(auto& it: A1) printf("%d ", it); puts("");
  ^~~
information.cpp:30:39: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  for(auto& it: A1) printf("%d ", it); puts("");
                                       ^~~~
information.cpp:22:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int N, M; scanf("%d%d",&N,&M);
            ~~~~~^~~~~~~~~~~~~~
information.cpp:24:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   int u, v; scanf("%d%d",&u,&v);
             ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 380 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 380 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 504 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 424 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 404 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 1656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 42 ms 2424 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 1716 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 504 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 194 ms 9392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 185 ms 9180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 200 ms 9464 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -