Submission #579174

#TimeUsernameProblemLanguageResultExecution timeMemory
579174Trisanu_DasKutije (COCI21_kutije)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int par[1001]; int Find(int x) { if(x == par[x]) { return x; } return par[x] = Find(par[x]); } void Unite(int a, int b) { a = Find(a), b = Find(b); if(a == b) { return; } par[a] = b; } void main() { int n, m, q; cin >> n >> m >> q; for(int i = 1; i <= n; i++) { par[i] = i; } for(int i = 1; i <= m; i++) { for(int j = 1; j <= n; j++) { int x; cin >> x; if(Find(x) != Find(j)) { Unite(x, j); } } } for(int i = 1; i <= q; i++) { int a, b; cin >> a >> b; if(Find(a) != Find(b)) { cout << "NE\n"; } else { cout << "DA\n"; } } }

Compilation message (stderr)

Main.cpp:25:1: error: '::main' must return 'int'
   25 | void main()
      | ^~~~