답안 #348512

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
348512 2021-01-15T05:48:50 Z arnold518 Information (CEOI08_information) C++14
0 / 100
238 ms 33052 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 2000;
const int MAXM = 1e6;

int N, M;
pii E[MAXM+10];
vector<pii> adj[MAXN+10];

int chk[MAXN+10];
bool vis[MAXN+10];
vector<int> V1, V2;

void dfs(int now, int col)
{
	vis[now]=true;
	for(pii nxt : adj[now])
	{
		if(chk[nxt.second]) continue;
		if(vis[nxt.first]) continue;
		if(col==1) V1.push_back(nxt.second);
		if(col==2) V2.push_back(nxt.second);

		chk[nxt.second]=col;
		dfs(nxt.first, col);
	}
}

int main()
{
	scanf("%d%d", &N, &M);
	for(int i=1; i<=M; i++)
	{
		int u, v;
		scanf("%d%d", &u, &v);
		E[i]={u, v};
		adj[u].push_back({v, i});
	}

	dfs(1, 1);
	dfs(1, 2);

	if(V1.size()!=N-1 || V2.size()!=N-1) return !printf("NONE");
	for(auto it : V1) printf("%d ", it); printf("\n");
	for(auto it : V2) printf("%d ", it); printf("\n");
}

Compilation message

information.cpp: In function 'int main()':
information.cpp:48:14: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   48 |  if(V1.size()!=N-1 || V2.size()!=N-1) return !printf("NONE");
      |     ~~~~~~~~~^~~~~
information.cpp:48:32: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   48 |  if(V1.size()!=N-1 || V2.size()!=N-1) return !printf("NONE");
      |                       ~~~~~~~~~^~~~~
information.cpp:49:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   49 |  for(auto it : V1) printf("%d ", it); printf("\n");
      |  ^~~
information.cpp:49:39: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   49 |  for(auto it : V1) printf("%d ", it); printf("\n");
      |                                       ^~~~~~
information.cpp:50:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   50 |  for(auto it : V2) printf("%d ", it); printf("\n");
      |  ^~~
information.cpp:50:39: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   50 |  for(auto it : V2) printf("%d ", it); printf("\n");
      |                                       ^~~~~~
information.cpp:36:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   36 |  scanf("%d%d", &N, &M);
      |  ~~~~~^~~~~~~~~~~~~~~~
information.cpp:40:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   40 |   scanf("%d%d", &u, &v);
      |   ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 364 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 492 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 1004 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 876 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 492 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 492 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 23 ms 4716 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 50 ms 7876 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 23 ms 4776 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 492 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 748 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 748 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 238 ms 32876 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Incorrect 196 ms 15980 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 234 ms 33052 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 748 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -