답안 #948856

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
948856 2024-03-18T15:34:13 Z vin Cijanobakterije (COCI21_cijanobakterije) C++17
6 / 70
16 ms 7004 KB
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>

const int INF = 2147483645;
const int maxN = (int)1e5+5;
const ll LLINF = LLONG_MAX;
//const ll mod = 998244353;
const ll mod = 1000000007;

vector<int> adj[maxN];
int dist[maxN];
bool vis[maxN], bck[maxN];

void dfs(int s) {
	for (auto i: adj[s]) {
		if (vis[i]) continue;
		vis[i] = true;
		dist[i] = dist[s]+1;
		dfs(i);
	}
}

void solv() {
	int n, m, a, b, mx=0;
	cin>>n>>m;
	for (int i=0;i<m;i++) {
		cin>>a>>b;
		bck[b] = true;
		adj[a].pb(b);
	}
//	for (int i=1;i<=n;i++) {
//		if (!bck[i]) {
//			dfs(i);
//		}
//	}
//	for (int i=1;i<=n;i++) {
//		mx = max(mx, dist[i]);
//	}
	cout<<n<<'\n';
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int t=1;
//    cin>>t;
    while (t--) solv();
}

Compilation message

Main.cpp: In function 'void solv()':
Main.cpp:30:18: warning: unused variable 'mx' [-Wunused-variable]
   30 |  int n, m, a, b, mx=0;
      |                  ^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 3676 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 7004 KB Output is correct
2 Correct 2 ms 3420 KB Output is correct
3 Correct 4 ms 3932 KB Output is correct
4 Correct 5 ms 4152 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3164 KB Output is correct
2 Correct 1 ms 3164 KB Output is correct
3 Correct 1 ms 3164 KB Output is correct
4 Correct 1 ms 3164 KB Output is correct
5 Incorrect 2 ms 3420 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 3160 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 3676 KB Output isn't correct
2 Halted 0 ms 0 KB -