Submission #534709

# Submission time Handle Problem Language Result Execution time Memory
534709 2022-03-08T15:09:35 Z 123477 Kutije (COCI21_kutije) C++14
0 / 70
660 ms 5760 KB
// ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⣛⡉⢹⢛⣛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿
// ⣿⣿⣿⣿⣿⣿⣿⡟⣫⡆⠀⣿⣷⣬⣼⡿⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⣿⣿⣿⣷⡘⢿⣾⡿⠿⠿⠛⢃⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣌⠫⠶⠿⠟⣋⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⣿⣿⣿⡏⠉⠏⠩⣭⣭⠉⠘⠉⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⣿⣿⣿⡇⠠⠤⠴⢯⣭⢤⠤⢄⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⣿⠋⠀⠀⠶⠬⢼⣸⣇⢠⠬⠼⠌⠀⠀⢹⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠙⠙⠛⠉⠀⠀⠀⠀⠠⣾⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⠏⠀⢀⣮⣅⣛⠻⠇⠿⢛⣃⣩⣴⠃⠀⠈⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣧⡀⠀⠘⢿⣿⠿⠟⠻⠟⣛⠻⢿⠿⠀⠀⣼⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⣿⢀⠀⠀⠲⠈⣭⣭⢩⣭⡴⠐⠀⠀⡌⣿⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⠇⣾⣷⣦⣀⠀⠀⠈⠀⠀⠀⣠⣴⣿⣿⡸⣿⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⡏⣼⣿⣿⣿⣿⣿⣶⣤⣀⣴⣿⣿⣿⣿⣿⣧⢹⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣿ 
// ⣿⣿⣿⣿⣿⣿⣿ HE HE HE HA ⣿⣿⣿⣿⣿⣿⣿
#include <bits/stdc++.h>
#define pb push_back
//
//#define endl "\n"
//#define int long long int 
using namespace std;
int matrix[1004][1004],n,m,q,ulas[1004][1004],vis[1004][1004];
vector <int> v[1004];
void dfs(int place,int parent){
    if(vis[place][parent]==1) return;
    vis[place][parent]=1;
    for(int i=0;i<v[place].size();i++){
            dfs(v[place][i],parent);
    }
    return;
}
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m >> q;
    int a;
    for(int i=1;i<=m;i++){
        for(int j=1;j<=n;j++){
            cin >> a;
            if(a!=j and matrix[a][j]==0)
                v[a].pb(j);            
            matrix[a][j]==1;
        }
    }
    for(int i=0;i<n;i++){
        dfs(i,i);
    }
    int b;
    for(int i=1;i<=q;i++){
        cin >> a >> b;
        if(vis[b][a]==1){
            cout << "DA" << endl;
            continue;
        }
        cout<< "NE" << endl;
    }
}































Compilation message

Main.cpp: In function 'void dfs(int, int)':
Main.cpp:27:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |     for(int i=0;i<v[place].size();i++){
      |                 ~^~~~~~~~~~~~~~~~
Main.cpp: In function 'int32_t main()':
Main.cpp:42:25: warning: statement has no effect [-Wunused-value]
   42 |             matrix[a][j]==1;
      |             ~~~~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 660 ms 5760 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 716 KB Output is correct
2 Incorrect 1 ms 716 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 716 KB Output is correct
2 Incorrect 1 ms 716 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 660 ms 5760 KB Output isn't correct
2 Halted 0 ms 0 KB -