Submission #675824

#TimeUsernameProblemLanguageResultExecution timeMemory
675824TangirkulKutije (COCI21_kutije)C++17
35 / 70
1047 ms18540 KiB
#include<bits/stdc++.h> #define ll long long #define fi first #define se second #define pb push_back #define sz size #define Junanna ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; const ll K = 32; const ll INF = 1e9 + 7; const ll MOD = 1e9 + 7; const ll N = (1e5 + 125); ll n, m, q; vector <ll> g[1007]; bool used[1007][1007]; void dfs (ll v, ll st) { used[st][v] = 1; for (ll i = 0; i < g[v].sz (); i++) { ll to = g[v][i]; if (!used[st][to]) { dfs (to, st); } } } void ma1n () { cin >> n >> m >> q; for (ll j = 1; j <= m; j++) { for (ll i = 1; i <= n; i++) { ll p; cin >> p; g[i].pb (p); } } for (ll i = 1; i <= n; i++) { dfs (i, i); } for (ll i = 1; i <= q; i++) { ll a, b; cin >> a >> b; if (used[a][b]) { cout << "DA\n"; } else { cout << "NE\n"; } } } int main () { Junanna; ll t = 1; while (t--) { ma1n (); } return 0; }

Compilation message (stderr)

Main.cpp: In function 'void dfs(long long int, long long int)':
Main.cpp:24:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for (ll i = 0; i < g[v].sz (); i++)
      |                    ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...